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:
authorCampbell Barton <ideasman42@gmail.com>2018-04-28 14:34:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-28 14:34:52 +0300
commita74097dc19d1b1d43797fe7dfbc4a2137ad21c22 (patch)
treefba62577508bdf18bcdb2d320d57d8e6b73cf7eb /source/blender/gpu/shaders
parent69ca12c45c8dfede5b6d088cfe22811fa345d4c2 (diff)
UI: Add icon color saturation preference
Toolbar icon saturation can now be set from the preferences, (use 0.4 by default).
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl
index 5b2ccb8ff3a..1ac0d68b35f 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl
@@ -1,4 +1,5 @@
+uniform float factor;
in vec2 texCoord_interp;
out vec4 fragColor;
@@ -8,6 +9,6 @@ uniform sampler2D image;
void main()
{
vec4 tex = texture(image, texCoord_interp);
- tex.rgb = 0.3333333 * vec3(tex.r + tex.g + tex.b);
+ tex.rgb = ((0.3333333 * factor) * vec3(tex.r + tex.g + tex.b)) + (tex.rgb * (1.0 - factor));
fragColor = tex * color;
}