diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-05-08 00:24:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-05-08 00:24:06 +0400 |
commit | 3527c100652f029db7a0e5af27a16456ff5ae1df (patch) | |
tree | b46239654e2d1a6c230d73a2ecad4cd1b0cbdb0b /source/blender | |
parent | 1584d6a0069758d8b594b0e2c412677ab5a8f22f (diff) |
Fix for bug #10932: area light bug, points behind the lamp could
also get lit.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 8 |
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 9f14db2f425..0928042729a 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -477,8 +477,12 @@ static float area_lamp_energy_multisample(LampRen *lar, float *co, float *vn) float *jitlamp= lar->jitter, vec[3]; float area[4][3], intens= 0.0f; int a= lar->ray_totsamp; - - + + /* test if co is behind lamp */ + VECSUB(vec, co, lar->co); + if(INPR(vec, lar->vec) < 0.0f) + return 0.0f; + while(a--) { vec[0]= jitlamp[0]; vec[1]= jitlamp[1]; |