diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-06-14 22:45:02 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-06-14 22:45:16 +0300 |
commit | 7afa59e37a539174385d8a2484e2b17ae43e0a85 (patch) | |
tree | 6e38a2bed7c0ec34c34a0129e013b1804cfa5611 | |
parent | dc25e69c2d5586d2635688ab18d2606be8c1ff57 (diff) |
Edit Mesh: Fix blending function of edges
This fix the ugly (usually) dark outline that was around selected edges.
-rw-r--r-- | source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl index b7935d43bff..eadb774c57e 100644 --- a/source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl @@ -94,7 +94,10 @@ float distToEdge(vec2 o, vec2 dir) #ifdef ANTI_ALIASING void colorDistEdge(vec4 color, float dist) { + /* May not work if color.a is not 1.0. */ + FragColor.rgb *= FragColor.a; FragColor = mix(color, FragColor, clamp(dist, 0.0, 1.0)); + FragColor.rgb /= FragColor.a; } #else #define colorDistEdge colorDist |