diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-21 14:15:12 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-21 14:15:12 +0400 |
commit | eb219852a839f23bfeb9dd5c24bb4bb90ef0c367 (patch) | |
tree | 195000a58f5222eb655d7f0af02add5aa5c33247 /source/blender/gpu/shaders | |
parent | ba868f1c50974695ea06228284cd6d2edf49f7b2 (diff) |
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.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
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); |