diff options
author | Antonioya <blendergit@gmail.com> | 2019-04-29 18:20:54 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-04-29 18:20:54 +0300 |
commit | a494be2f2ed0d6dcda8358d261afd4c8c3f65202 (patch) | |
tree | b704cc789f8d493e2d17d0a90fbffd3652f878eb /source/blender/draw | |
parent | 11b65b4ade618eff8fb6208ba3495729c2d3140a (diff) |
Fix T63979: GPencil control points hidden in orthographic mode
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/gpencil/shaders/gpencil_edit_point_geom.glsl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_edit_point_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_edit_point_geom.glsl index b5d0a5bce71..8c3fd022004 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_edit_point_geom.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_edit_point_geom.glsl @@ -16,6 +16,12 @@ vec2 toScreenSpace(vec4 vertex) return vec2(vertex.xy / vertex.w) * Viewport; } +/* get zdepth value */ +float getZdepth(vec4 point) +{ + return min(-0.05, (point.z / point.w)); +} + void main(void) { vec4 P0 = gl_in[0].gl_Position; @@ -26,22 +32,22 @@ void main(void) /* generate the triangle strip */ mTexCoord = vec2(0, 1); mColor = finalColor[0]; - gl_Position = vec4(vec2(sp0.x - size, sp0.y + size) / Viewport, 0, 1.0); + gl_Position = vec4(vec2(sp0.x - size, sp0.y + size) / Viewport, getZdepth(P0), 1.0); EmitVertex(); mTexCoord = vec2(0, 0); mColor = finalColor[0]; - gl_Position = vec4(vec2(sp0.x - size, sp0.y - size) / Viewport, 0, 1.0); + gl_Position = vec4(vec2(sp0.x - size, sp0.y - size) / Viewport, getZdepth(P0), 1.0); EmitVertex(); mTexCoord = vec2(1, 1); mColor = finalColor[0]; - gl_Position = vec4(vec2(sp0.x + size, sp0.y + size) / Viewport, 0, 1.0); + gl_Position = vec4(vec2(sp0.x + size, sp0.y + size) / Viewport, getZdepth(P0), 1.0); EmitVertex(); mTexCoord = vec2(1, 0); mColor = finalColor[0]; - gl_Position = vec4(vec2(sp0.x + size, sp0.y - size) / Viewport, 0, 1.0); + gl_Position = vec4(vec2(sp0.x + size, sp0.y - size) / Viewport, getZdepth(P0), 1.0); EmitVertex(); EndPrimitive(); |