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:
Diffstat (limited to 'source/blender/render/intern/source/shadeoutput.c')
-rw-r--r--source/blender/render/intern/source/shadeoutput.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 5b69323667e..5a80173d1f1 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1761,7 +1761,21 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
if(shi->combinedflag & SCE_PASS_SPEC)
VECADD(shr->combined, shr->combined, shr->spec);
+ /* modulate by the object color */
+ if((ma->shade_flag & MA_OBCOLOR) && shi->obr->ob) {
+ if(!(ma->sss_flag & MA_DIFF_SSS) || !has_sss_tree(&R, ma)) {
+ float obcol[4];
+
+ QUATCOPY(obcol, shi->obr->ob->col);
+ CLAMP(obcol[3], 0.0f, 1.0f);
+
+ shr->combined[0] *= obcol[0];
+ shr->combined[1] *= obcol[1];
+ shr->combined[2] *= obcol[2];
+ shr->alpha *= obcol[3];
+ }
+ }
+
shr->combined[3]= shr->alpha;
}
-