diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-10-15 18:31:44 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-10-15 18:31:44 +0300 |
commit | 2a9b162d94576d0182661179cf0500cfbc85236f (patch) | |
tree | 0104c1c0a43e7257734bb7fccb86bc4b766642a1 /source/blender/gpu/shaders/material/gpu_shader_material_mix_rgb.glsl | |
parent | c2a7e790475d185fc73e7f4210f3e458535d88b8 (diff) |
Fix T70605: incorrect darken and lighten rgb mix mode
Differential Revision: https://developer.blender.org/D6058
Reviewers: brecht, fclem
Diffstat (limited to 'source/blender/gpu/shaders/material/gpu_shader_material_mix_rgb.glsl')
-rw-r--r-- | source/blender/gpu/shaders/material/gpu_shader_material_mix_rgb.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_mix_rgb.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_mix_rgb.glsl index abe6081489d..e089aec1d92 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_mix_rgb.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_mix_rgb.glsl @@ -92,14 +92,14 @@ void mix_diff(float fac, vec4 col1, vec4 col2, out vec4 outcol) void mix_dark(float fac, vec4 col1, vec4 col2, out vec4 outcol) { fac = clamp(fac, 0.0, 1.0); - outcol.rgb = min(col1.rgb, col2.rgb * fac); + outcol.rgb = mix(col1.rgb, min(col1.rgb, col2.rgb), fac); outcol.a = col1.a; } void mix_light(float fac, vec4 col1, vec4 col2, out vec4 outcol) { fac = clamp(fac, 0.0, 1.0); - outcol.rgb = max(col1.rgb, col2.rgb * fac); + outcol.rgb = mix(col1.rgb, max(col1.rgb, col2.rgb), fac); outcol.a = col1.a; } |