diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-30 19:27:45 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-30 19:27:45 +0400 |
commit | 06c6d3235caf9001c5be5318a30261728cf71466 (patch) | |
tree | da138f91416e8daf77f6df3bde4c2461c283b7c7 /source/blender/render | |
parent | 414fadb192f9e32e80828d213093859e0b912783 (diff) |
Fix #36884: blender spotlamp halo render was incorrectly showing light on the
backside of objects, after bugfix in revision 56145.
It now still always renders one step, but step size is clamped to fit within
the halo volume.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/shadbuf.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 0d85cfe78b7..0c3bf85cd24 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -1373,7 +1373,7 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3]) /* printf("start %x %x \n", (int)(0x7FFFFFFF*zf1), (int)(0x7FFFFFFF*zf2)); */ - while (1) { + do { lambda_o= lambda; if (lambda_x==lambda_y) { @@ -1394,7 +1394,13 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3]) } lambda = min_ff(lambda_x, lambda_y); - + + /* not making any progress? */ + if (lambda==lambda_o) break; + + /* clip to end of volume */ + lambda = min_ff(lambda, 1.0f); + zf= zf1 + lambda*(zf2-zf1); count+= (float)shb->totbuf; @@ -1409,10 +1415,9 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3]) lightcount+= readshadowbuf_halo(shb, shsample, x, y, z); } - /* break after sample, so it takes at least one */ - if (lambda==lambda_o || lambda>=1.0f) break; } - + while (lambda < 1.0f); + if (count!=0.0f) return (lightcount/count); return 0.0f; |