diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-03-29 21:37:44 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-03-29 21:46:42 +0300 |
commit | 0b57ecc665cdf37f1e24bfb293fa56c2279aac0f (patch) | |
tree | 16a8facb2a0215b374fd565e6079c5aa5859af79 | |
parent | a022cb8f62bed6487247697dc66337080b0ac558 (diff) |
Overlay: Edit Mesh: Make offset depth dependent (w.r.t depth precision)
The previous offset was done in view space. It is now done in NDC space
to avoid differences when adjusting the near/far plane distances.
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl index 768b0596d17..84dbf85816f 100644 --- a/source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl @@ -48,10 +48,10 @@ void main() gl_PointSize = sizeVertex * 2.0; /* Make selected and active vertex always on top. */ if ((data.x & VERT_SELECTED) != 0) { - gl_Position.z -= 1e-7; + gl_Position.z -= 5e-7 * abs(gl_Position.w); } if ((data.x & VERT_ACTIVE) != 0) { - gl_Position.z -= 1e-7; + gl_Position.z -= 5e-7 * abs(gl_Position.w); } bool occluded = test_occlusion(); |