From 1fa183c27ebc09662c8a06a6461fafbb218d0a0b Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 25 Jun 2006 15:32:42 +0000 Subject: [PATCH] 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. --- source/blender/render/intern/source/rendercore.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index f82c433172a..812c0e19335 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -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);