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
path: root/source
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2007-07-28 01:54:01 +0400
committerJoseph Eagar <joeedh@gmail.com>2007-07-28 01:54:01 +0400
commit34e4388a5cd3782b40f723df2e3603a104be7cbc (patch)
tree6d8a83011940df87958ddf35cd8ba2b9c818e29b /source
parentc3457718a407a1ecfc4d44d285da4b3d74da1868 (diff)
Previous bugfix for shadows cast on objects with diffuse reflectivity set to 0
caused errors on only shadow lamps; fixed this by adding back in the original intensity > 0.0 check in the only shadow if statement, where it belonged in the first place. In addition, the specular pass was not correctly affected by only shadow lamps, severely reducing the usefulness of this feature. For example, using four spotlamps to create an omnidirectional buffered shadow lamp didn't work.
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/shadeoutput.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 2bddc86e3f8..b009d9ce755 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1245,12 +1245,16 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
lamp_get_shadow(lar, shi, inp, shadfac, shi->depth);
/* warning, here it skips the loop */
- if(lar->mode & LA_ONLYSHADOW) {
+ if((lar->mode & LA_ONLYSHADOW) && i>0.0) {
shadfac[3]= i*lar->energy*(1.0f-shadfac[3]);
shr->shad[0] -= shadfac[3]*shi->r;
shr->shad[1] -= shadfac[3]*shi->g;
shr->shad[2] -= shadfac[3]*shi->b;
+
+ shr->spec[0] -= shadfac[3]*shi->r;
+ shr->spec[1] -= shadfac[3]*shi->g;
+ shr->spec[2] -= shadfac[3]*shi->b;
return;
}
@@ -1280,7 +1284,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
}
/* specularity */
- if(shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC)) {
+ if(shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC) && !(lar->mode & LA_ONLYSHADOW)) {
if(!(passflag & (SCE_PASS_COMBINED|SCE_PASS_SPEC)));
else if(lar->type==LA_HEMI) {