[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60446] trunk/blender/source/blender/ render/intern/source/shadbuf.c: Fix #36884: blender spotlamp halo render was incorrectly showing light on the

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Sep 30 17:27:45 CEST 2013


Revision: 60446
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60446
Author:   blendix
Date:     2013-09-30 15:27:45 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
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.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56145

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/shadbuf.c

Modified: trunk/blender/source/blender/render/intern/source/shadbuf.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadbuf.c	2013-09-30 14:40:03 UTC (rev 60445)
+++ trunk/blender/source/blender/render/intern/source/shadbuf.c	2013-09-30 15:27:45 UTC (rev 60446)
@@ -1373,7 +1373,7 @@
 
 /* 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 @@
 		}
 		
 		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 @@
 				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;
 	




More information about the Bf-blender-cvs mailing list