diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-03-29 21:42:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-03-29 21:49:07 +0300 |
commit | bf3b0db785fd4c6575c22340e6a92328538ff790 (patch) | |
tree | d905972fd430ab33d6e51e1ed3162e2b408ff2cf /source | |
parent | 0b57ecc665cdf37f1e24bfb293fa56c2279aac0f (diff) |
Overlay: Edit Mesh: Add offset for thicker edges
Edges with sharpness, seam and bevel are thicker and thus needs more offset
to not appear aliased.
Based on D5448 by @oficsu
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl | 4 |
1 files changed, 4 insertions, 0 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 84dbf85816f..203f6cb1901 100644 --- a/source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/edit_mesh_vert.glsl @@ -69,6 +69,10 @@ void main() float bweight = float(m_data.w) / 255.0; finalColorOuter = EDIT_MESH_edge_color_outer(m_data.y, m_data.x, crease, bweight); + if (finalColorOuter.a > 0.0) { + gl_Position.z -= 5e-7 * abs(gl_Position.w); + } + bool occluded = false; /* Done in fragment shader */ #elif defined(FACE) |