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:
authorAntony Riakiotakis <kalast@gmail.com>2014-08-18 21:14:51 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-18 21:14:51 +0400
commitb07ea2fc15ac5593442570f0bcb67c84b620b203 (patch)
tree1102173b5e85f8781547e8b2c68a81e6a223fa09 /source/blender/gpu/shaders/gpu_shader_material.glsl
parente1eb2e99f78b6fe66a8a16d1f4a7b0b90e364315 (diff)
Fix T41456: soft light texture blend mode zero effect
Soft light and Linear light blend modes weren't implemented in glsl Reviewers: psy-fi Maniphest Tasks: T41456 Differential Revision: https://developer.blender.org/D744
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_material.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index fb364018282..fe0c7c2b715 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -1012,6 +1012,38 @@ void mtex_rgb_color(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 i
incol.rgb = col.rgb;
}
+void mtex_rgb_soft(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm;
+
+ fact *= facg;
+ facm = 1.0-fact;
+
+ vec3 one = vec3(1.0);
+ vec3 scr = one - (one - texcol)*(one - outcol);
+ incol = facm*outcol + fact*((one - texcol)*outcol*texcol + outcol*scr);
+}
+
+void mtex_rgb_linear(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ fact *= facg;
+
+ if(texcol.r > 0.5)
+ incol.r = outcol.r + fact*(2.0*(texcol.r - 0.5));
+ else
+ incol.r = outcol.r + fact*(2.0*(texcol.r) - 1.0);
+
+ if(texcol.g > 0.5)
+ incol.g = outcol.g + fact*(2.0*(texcol.g - 0.5));
+ else
+ incol.g = outcol.g + fact*(2.0*(texcol.g) - 1.0);
+
+ if(texcol.b > 0.5)
+ incol.b = outcol.b + fact*(2.0*(texcol.b - 0.5));
+ else
+ incol.b = outcol.b + fact*(2.0*(texcol.b) - 1.0);
+}
+
void mtex_value_vars(inout float fact, float facg, out float facm)
{
fact *= abs(facg);