Fix for bug #10932: area light bug, points behind the lamp could
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 7 May 2008 20:24:06 +0000 (20:24 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 7 May 2008 20:24:06 +0000 (20:24 +0000)
also get lit.

source/blender/render/intern/source/shadeoutput.c

index 9f14db2f42519f619436c18940069227e04ea338..0928042729a5c65a26cf3fb467e3246e43fbb567 100644 (file)
@@ -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];