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:
authorRobert Holcomb <bob_holcomb@hotmail.com>2009-09-10 07:00:50 +0400
committerRobert Holcomb <bob_holcomb@hotmail.com>2009-09-10 07:00:50 +0400
commitdac27004b863da96c57b071fc0479680e06a9725 (patch)
treefcabe2c16a70aa67078e45e679a54306a48b76e3 /source/blender/render
parentd6a706dee9b59e32ca9c60645680ea4170e6c1d4 (diff)
committing patch #19252-Soft/Linear Light blend modes+Darken mode bug fix
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/texture.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 4d4a2c04808..2d2c01e0bf1 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -1455,12 +1455,22 @@ void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg
VECCOPY(in, out);
ramp_blend(MA_RAMP_COLOR, in, in+1, in+2, fact, tex);
break;
+ case MTEX_SOFT_LIGHT:
+ fact*= facg;
+ VECCOPY(in, out);
+ ramp_blend(MA_RAMP_SOFT, in, in+1, in+2, fact, tex);
+ break;
+ case MTEX_LIN_LIGHT:
+ fact*= facg;
+ VECCOPY(in, out);
+ ramp_blend(MA_RAMP_LINEAR, in, in+1, in+2, fact, tex);
+ break;
}
}
float texture_value_blend(float tex, float out, float fact, float facg, int blendtype, int flip)
{
- float in=0.0, facm, col;
+ float in=0.0, facm, col, scf;
fact*= facg;
facm= 1.0-fact;
@@ -1505,6 +1515,19 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
col= fact*tex;
if(col > out) in= col; else in= out;
break;
+
+ case MTEX_SOFT_LIGHT:
+ col= fact*tex;
+ scf=1.0 - (1.0 - tex) * (1.0 - out);
+ in= facm*out + fact * ((1.0 - out) * tex * out) + (out * scf);
+ break;
+
+ case MTEX_LIN_LIGHT:
+ if (tex > 0.5)
+ in = out + fact*(2*(tex - 0.5));
+ else
+ in = out + fact*(2*tex - 1);
+ break;
}
return in;