Commit: e4ad8efb2e6b785fbb60c13192463c1ce5b70108
Author: Jeroen Bakker
Date: Thu Sep 10 15:46:01 2020 +0200
Branches: uvimage-editor-drawing
https://developer.blender.org/rBe4ad8efb2e6b785fbb60c13192463c1ce5b70108
Better description for the depth ordering
===================================================================
M source/blender/draw/engines/image/shaders/engine_image_vert.glsl
M source/blender/draw/engines/overlay/shaders/edit_uv_edges_vert.glsl
M source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
===================================================================
diff --git a/source/blender/draw/engines/image/shaders/engine_image_vert.glsl
b/source/blender/draw/engines/image/shaders/engine_image_vert.glsl
index 8beb078520b..3f1fb154d44 100644
--- a/source/blender/draw/engines/image/shaders/engine_image_vert.glsl
+++ b/source/blender/draw/engines/image/shaders/engine_image_vert.glsl
@@ -21,8 +21,10 @@ void main()
vec3 world_pos = point_object_to_world(image_pos);
vec4 position = point_world_to_ndc(world_pos);
/* Move drawn pixels to the front. In the overlay engine the depth is used
- * to detect if a transparency texture or the background color should be
drawn. */
- position.z = 0.5;
+ * to detect if a transparency texture or the background color should be
drawn.
+ * Vertices are between 0.0 and 0.2, Edges between 0.2 and 0.4
+ * actual pixels are at 0.75, 1.0 is used for the background. */
+ position.z = 0.75;
gl_Position = position;
uvs = world_pos.xy;
}
diff --git
a/source/blender/draw/engines/overlay/shaders/edit_uv_edges_vert.glsl
b/source/blender/draw/engines/overlay/shaders/edit_uv_edges_vert.glsl
index 8e8950af244..3db6cc1d3c1 100644
--- a/source/blender/draw/engines/overlay/shaders/edit_uv_edges_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/edit_uv_edges_vert.glsl
@@ -21,7 +21,10 @@ void main()
bool is_select = (flag & VERT_UV_SELECT) != 0;
selectionFac = is_select ? 1.0 : 0.0;
- float depth = is_select ? 0.3 : 0.4;
+ /* Move selected edges to the top
+ * Vertices are between 0.0 and 0.2, Edges between 0.2 and 0.4
+ * actual pixels are at 0.75, 1.0 is used for the background. */
+ float depth = is_select ? 0.25 : 0.35;
gl_Position.z = depth;
/* Avoid precision loss. */
diff --git
a/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
b/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
index 5ae4a808146..327a35ce6b2 100644
--- a/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
@@ -23,8 +23,10 @@ void main()
outlineColor = (is_pinned) ? pinned_col : vec4(fillColor.rgb, 0.0);
vec3 world_pos = point_object_to_world(vec3(u, 0.0));
- /* Move selected vertices to the top */
- float depth = is_selected ? 0.1 : 0.2;
+ /* Move selected vertices to the top
+ * Vertices are between 0.0 and 0.2, Edges between 0.2 and 0.4
+ * actual pixels are at 0.75, 1.0 is used for the background. */
+ float depth = is_selected ? 0.05 : 0.15;
gl_Position = vec4(point_world_to_ndc(world_pos).xy, depth, 1.0);
gl_PointSize = pointSize;
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs