Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-11-05 14:53:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-05 18:31:12 +0300
commit2ae88c4d78945e05d27bca608468d34b51927b7d (patch)
tree21be13c079fc9802ec8adc533c79862ba2d97710 /source/blender/draw/modes/shaders/object_grid_frag.glsl
parent205d1876ff53ed890b79814d412e0d59927359b2 (diff)
UI: Make the grid alpha themable
Now that the 3d grid is infinite, antialiased, not occluded, and overlaid on top of rendered view, being able to decrease its opacity to reduce visual strain is a must.
Diffstat (limited to 'source/blender/draw/modes/shaders/object_grid_frag.glsl')
-rw-r--r--source/blender/draw/modes/shaders/object_grid_frag.glsl7
1 files changed, 4 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 928db048a46..3ccb10ca4ab 100644
--- a/source/blender/draw/modes/shaders/object_grid_frag.glsl
+++ b/source/blender/draw/modes/shaders/object_grid_frag.glsl
@@ -172,9 +172,10 @@ void main()
float gridB = get_grid(grid_pos, grid_fwidth, scaleB);
float gridC = get_grid(grid_pos, grid_fwidth, scaleC);
- FragColor = vec4(colorGrid.rgb, gridA * blend);
- FragColor = mix(FragColor, vec4(mix(colorGrid.rgb, colorGridEmphasise.rgb, blend), 1.0), gridB);
- FragColor = mix(FragColor, vec4(colorGridEmphasise.rgb, 1.0), gridC);
+ FragColor = colorGrid;
+ FragColor.a *= gridA * blend;
+ FragColor = mix(FragColor, mix(colorGrid, colorGridEmphasise, blend), gridB);
+ FragColor = mix(FragColor, colorGridEmphasise, gridC);
}
else {
FragColor = vec4(colorGrid.rgb, 0.0);