diff options
author | Ton Roosendaal <ton@blender.org> | 2006-06-27 16:01:33 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-06-27 16:01:33 +0400 |
commit | 8d2f04ac747cae13c544b9253c65ac6fa16082c7 (patch) | |
tree | a284d5b0d030287b82f42ffa47d2473aed1bc22b | |
parent | 676d5d7b74e450f3777ec7f51698f4083812f591 (diff) |
Bugfix #4495
Another old only-shadow material error: spot lights with ray-shadow still
calculated shadow on faces that were pointing away from the lamp.
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 812c0e19335..70be76e4a6f 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -1748,17 +1748,18 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) inp= vn[0]*lv[0] + vn[1]*lv[1] + vn[2]*lv[2]; - if(lar->shb) { - /* lampbuffer returns 0.0 on backfacing normals now */ - if(inp <= 0.0f) - i= 1.0f; - else - i = testshadowbuf(lar->shb, shi->co, shi->dxco, shi->dyco, inp); - } + /* lampbuffer also returns 0.0 on backfacing normals now */ + if(inp <= 0.0f) + i= 1.0f; else { - float shad[4]; - ray_shadow(shi, lar, shad); - i= shad[3]; + if(lar->shb) { + i = testshadowbuf(lar->shb, shi->co, shi->dxco, shi->dyco, inp); + } + else { + float shad[4]; + ray_shadow(shi, lar, shad); + i= shad[3]; + } } t= inpr - lar->spotsi; |