[Bf-blender-cvs] [7afa59e37a5] blender2.8: Edit Mesh: Fix blending function of edges

Clément Foucault noreply at git.blender.org
Thu Jun 14 21:45:10 CEST 2018


Commit: 7afa59e37a539174385d8a2484e2b17ae43e0a85
Author: Clément Foucault
Date:   Thu Jun 14 21:45:02 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB7afa59e37a539174385d8a2484e2b17ae43e0a85

Edit Mesh: Fix blending function of edges

This fix the ugly (usually) dark outline that was around selected edges.

===================================================================

M	source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl

===================================================================

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



More information about the Bf-blender-cvs mailing list