diff options
author | Lukas Steiblys <imbusy@imbusy.org> | 2009-10-02 02:29:15 +0400 |
---|---|---|
committer | Lukas Steiblys <imbusy@imbusy.org> | 2009-10-02 02:29:15 +0400 |
commit | 0677398a649b6b8c293df3ce3c6668f0a3be3bc8 (patch) | |
tree | 9d510a5bd23559bf4fae670ed04d7e5d6c12578c /source/blender/gpu/intern/gpu_shader_material.glsl | |
parent | 59248e9f62006ba05e3098e4d213f3dcb23fe711 (diff) | |
parent | bc942eceacb638735dc4f4f68252c4c207147a70 (diff) |
merge from 23153 to 23595soc-2009-imbusy
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader_material.glsl')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader_material.glsl | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/gpu/intern/gpu_shader_material.glsl b/source/blender/gpu/intern/gpu_shader_material.glsl index 16ed38cb47d..0d7e00a541b 100644 --- a/source/blender/gpu/intern/gpu_shader_material.glsl +++ b/source/blender/gpu/intern/gpu_shader_material.glsl @@ -847,66 +847,66 @@ void mtex_rgb_color(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 i incol.rgb = col.rgb; } -void mtex_value_vars(inout float fact, float facg, out float facm, float flip) +void mtex_value_vars(inout float fact, float facg, out float facm) { - fact *= facg; + fact *= abs(facg); facm = 1.0-fact; - if(flip != 0.0) { + if(facg < 0.0) { float tmp = fact; fact = facm; facm = tmp; } } -void mtex_value_blend(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_blend(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); incol = fact*texcol + facm*outcol; } -void mtex_value_mul(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_mul(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); facm = 1.0 - facg; incol = (facm + fact*texcol)*outcol; } -void mtex_value_screen(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_screen(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); facm = 1.0 - facg; incol = 1.0 - (facm + fact*(1.0 - texcol))*(1.0 - outcol); } -void mtex_value_sub(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_sub(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); fact = -fact; incol = fact*texcol + outcol; } -void mtex_value_add(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_add(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); fact = fact; incol = fact*texcol + outcol; } -void mtex_value_div(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_div(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); if(texcol != 0.0) incol = facm*outcol + fact*outcol/texcol; @@ -914,27 +914,27 @@ void mtex_value_div(float outcol, float texcol, float fact, float facg, float fl incol = 0.0; } -void mtex_value_diff(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_diff(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); incol = facm*outcol + fact*abs(texcol - outcol); } -void mtex_value_dark(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_dark(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); float col = fact*texcol; if(col < outcol) incol = col; else incol = outcol; } -void mtex_value_light(float outcol, float texcol, float fact, float facg, float flip, out float incol) +void mtex_value_light(float outcol, float texcol, float fact, float facg, out float incol) { float facm; - mtex_value_vars(fact, facg, facm, flip); + mtex_value_vars(fact, facg, facm); float col = fact*texcol; if(col > outcol) incol = col; else incol = outcol; |