diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-08-23 14:35:41 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-08-23 14:56:39 +0300 |
commit | 745123024d1c6ece6c4033d9ba6a5607ed4b08b7 (patch) | |
tree | 11c076ae3defd2678cfda99169b322c14faa3166 /source | |
parent | 55f122264c7faeedb4cdb1b3d1038ac3af28f6f2 (diff) |
3D Grid: Fix axes color blending
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/modes/shaders/object_grid_frag.glsl | 9 |
1 files changed, 6 insertions, 3 deletions
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; } } |