Material option "Only shadow" didn't work 100% anymore since shadowbuffer
returns 0.0 (shadow) on backfacing normals.

Added extra test in code to solve this.
This commit is contained in:
Ton Roosendaal 2006-06-25 15:32:42 +00:00
parent a966a72cd6
commit 1fa183c27e

@ -1748,7 +1748,13 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
inp= vn[0]*lv[0] + vn[1]*lv[1] + vn[2]*lv[2]; inp= vn[0]*lv[0] + vn[1]*lv[1] + vn[2]*lv[2];
if(lar->shb) i = testshadowbuf(lar->shb, shi->co, shi->dxco, shi->dyco, inp); 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);
}
else { else {
float shad[4]; float shad[4];
ray_shadow(shi, lar, shad); ray_shadow(shi, lar, shad);