[Bf-blender-cvs] [7f65eb3] master: Fix part of T47025: Shadow pass error: Black shadow.
Bastien Montagne
noreply at git.blender.org
Fri Jan 22 19:39:38 CET 2016
Commit: 7f65eb3f5346c101d7a341ca0071f2f1a26198db
Author: Bastien Montagne
Date: Fri Jan 22 19:32:47 2016 +0100
Branches: master
https://developer.blender.org/rB7f65eb3f5346c101d7a341ca0071f2f1a26198db
Fix part of T47025: Shadow pass error: Black shadow.
Skipping computing of shadow pass when diffuse color is pitch black is fine... unless
you actually need/want that shadow pass!
The 'noisy' issue with picture texture remains a bit mysterious to me currently. :/
===================================================================
M source/blender/render/intern/source/shadeoutput.c
===================================================================
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 3b7c7b1..27c0f5d 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1914,8 +1914,8 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
copy_v3_v3(shr->combined, shr->diffshad);
/* calculate shadow pass, we use a multiplication mask */
- /* if diff = 0,0,0 it doesn't matter what the shadow pass is, so leave it as is */
- if (passflag & SCE_PASS_SHADOW && !(shr->diff[0]==0.0f && shr->diff[1]==0.0f && shr->diff[2]==0.0f)) {
+ /* Even if diff = 0,0,0, it does matter what the shadow pass is, since we may want it 'for itself'! */
+ if (passflag & SCE_PASS_SHADOW) {
if (shr->diff[0]!=0.0f) shr->shad[0]= shr->shad[0]/shr->diff[0];
/* can't determine proper shadow from shad/diff (0/0), so use shadow intensity */
else if (shr->shad[0]==0.0f) shr->shad[0]= shr->shad[3];
More information about the Bf-blender-cvs
mailing list