Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-09-29 20:42:09 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-01 16:14:46 +0300
commit781995a09c0b52ad2fd073510c2f7dc52383d461 (patch)
treef821cce3fa5f69435a20e450d709fec37cb95b4a /source/blender/gpu/shaders/gpu_shader_2D_edituvs_facedots_vert.glsl
parenta5101de6a95647d19821bde9f8d68776ce8881fa (diff)
Edit UVs: Refactor drawing Edit UV in Image Editor
NOTE: This commit only concern edit UVs and not the "shadow" mesh displayed when texture painting. This will be address in a future commit. We now cache the uv mesh in the mesh batch cache and only reupload data on changes. Update could be more granular (and a bit faster) but it's not our main concern ATM. This should fix problem caused by the IMM api used to draw large meshes. This makes performance skyrocket compared to previous implementation. There is still a big CPU bottleneck when not in sync selection mode but it is not related to the drawing function directly.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_edituvs_facedots_vert.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_edituvs_facedots_vert.glsl17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_edituvs_facedots_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_edituvs_facedots_vert.glsl
new file mode 100644
index 00000000000..4f3f8917286
--- /dev/null
+++ b/source/blender/gpu/shaders/gpu_shader_2D_edituvs_facedots_vert.glsl
@@ -0,0 +1,17 @@
+
+uniform mat4 ModelViewProjectionMatrix;
+uniform vec4 vertColor;
+uniform vec4 selectColor;
+
+in vec2 pos;
+in int flag;
+
+out vec4 finalColor;
+
+#define FACE_SELECT (1 << 2)
+
+void main()
+{
+ gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);
+ finalColor = ((flag & FACE_SELECT) != 0) ? selectColor : vertColor;
+} \ No newline at end of file