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. :/
This commit is contained in:
Bastien Montagne 2016-01-22 19:32:47 +01:00
parent 477078defa
commit 7f65eb3f53
1 changed files with 2 additions and 2 deletions

View File

@ -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];