From eb219852a839f23bfeb9dd5c24bb4bb90ef0c367 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 21 Dec 2012 10:15:12 +0000 Subject: Bug fix #33639 Material Texture blend modes Screen, Overlay and Multiply didn't respect the alpha for textures... an error I could trace back to 2004 even. Obviously the fix should be done, but it might change the appearance of renders somewhat. Will keep an eye open if this is worth ugly version-patching. Now: image textures with alpha, will only apply the blend modes respecting the alpha values. --- source/blender/gpu/shaders/gpu_shader_material.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu/shaders') diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 9a238e979fa..c6b0a758208 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -811,7 +811,7 @@ void mtex_rgb_mul(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 inc float facm; fact *= facg; - facm = 1.0-facg; + facm = 1.0-fact; incol = (facm + fact*texcol)*outcol; } @@ -821,7 +821,7 @@ void mtex_rgb_screen(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 float facm; fact *= facg; - facm = 1.0-facg; + facm = 1.0-fact; incol = vec3(1.0) - (vec3(facm) + fact*(vec3(1.0) - texcol))*(vec3(1.0) - outcol); } @@ -831,7 +831,7 @@ void mtex_rgb_overlay(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 float facm; fact *= facg; - facm = 1.0-facg; + facm = 1.0-fact; if(outcol.r < 0.5) incol.r = outcol.r*(facm + 2.0*fact*texcol.r); -- cgit v1.2.3