forked from bartvdbraak/blender
Fix #4472
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:
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];
|
||||
|
||||
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 {
|
||||
float shad[4];
|
||||
ray_shadow(shi, lar, shad);
|
||||
|
Loading…
Reference in New Issue
Block a user