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); diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 2b189352a37..e3bfd535f11 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1339,7 +1339,7 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa case MTEX_MUL: fact*= facg; - facm= 1.0f-facg; + facm= 1.0f-fact; in[0]= (facm+fact*tex[0])*out[0]; in[1]= (facm+fact*tex[1])*out[1]; in[2]= (facm+fact*tex[2])*out[2]; @@ -1347,7 +1347,7 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa case MTEX_SCREEN: fact*= facg; - facm= 1.0f-facg; + facm= 1.0f-fact; in[0]= 1.0f - (facm+fact*(1.0f-tex[0])) * (1.0f-out[0]); in[1]= 1.0f - (facm+fact*(1.0f-tex[1])) * (1.0f-out[1]); in[2]= 1.0f - (facm+fact*(1.0f-tex[2])) * (1.0f-out[2]); @@ -1355,7 +1355,7 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa case MTEX_OVERLAY: fact*= facg; - facm= 1.0f-facg; + facm= 1.0f-fact; if (out[0] < 0.5f) in[0] = out[0] * (facm + 2.0f*fact*tex[0]);