[Bf-blender-cvs] [745123024d1] blender2.8: 3D Grid: Fix axes color blending

Clément Foucault noreply at git.blender.org
Thu Aug 23 13:56:43 CEST 2018


Commit: 745123024d1c6ece6c4033d9ba6a5607ed4b08b7
Author: Clément Foucault
Date:   Thu Aug 23 13:35:41 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB745123024d1c6ece6c4033d9ba6a5607ed4b08b7

3D Grid: Fix axes color blending

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

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

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

diff --git a/source/blender/draw/modes/shaders/object_grid_frag.glsl b/source/blender/draw/modes/shaders/object_grid_frag.glsl
index 06369e80c8d..aa2b45b5b50 100644
--- a/source/blender/draw/modes/shaders/object_grid_frag.glsl
+++ b/source/blender/draw/modes/shaders/object_grid_frag.glsl
@@ -199,13 +199,16 @@ void main()
 		vec3 axes = get_axes(axes_dist, axes_fwidth, 0.1);
 
 		if ((gridFlag & AXIS_X) != 0) {
-			FragColor = mix(FragColor, colorGridAxisX, axes.x);
+			FragColor.a = max(FragColor.a, axes.x);
+			FragColor.rgb = (axes.x < 1e-8) ? FragColor.rgb : colorGridAxisX.rgb;
 		}
 		if ((gridFlag & AXIS_Y) != 0) {
-			FragColor = mix(FragColor, colorGridAxisY, axes.y);
+			FragColor.a = max(FragColor.a, axes.y);
+			FragColor.rgb = (axes.y < 1e-8) ? FragColor.rgb : colorGridAxisY.rgb;
 		}
 		if ((gridFlag & AXIS_Z) != 0) {
-			FragColor = mix(FragColor, colorGridAxisZ, axes.z);
+			FragColor.a = max(FragColor.a, axes.z);
+			FragColor.rgb = (axes.z < 1e-8) ? FragColor.rgb : colorGridAxisZ.rgb;
 		}
 	}



More information about the Bf-blender-cvs mailing list