[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56145] trunk/blender/source/blender/ render/intern/source: Bugfix #34895

Ton Roosendaal ton at blender.org
Thu Apr 18 18:26:58 CEST 2013


Revision: 56145
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56145
Author:   ton
Date:     2013-04-18 16:26:58 +0000 (Thu, 18 Apr 2013)
Log Message:
-----------
Bugfix #34895

Error in shadowbuffer with halo effect. It had render error when you look straight into
the lamp, with something in front of lamp.

The code that was sampling the shadowbuffer exited too soon (for ray going perpendicular to buffer it should take at least 1 sample).

Code from 90ies. And still got a bug fix. Whoa :)

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

Modified: trunk/blender/source/blender/render/intern/source/shadbuf.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadbuf.c	2013-04-18 15:26:22 UTC (rev 56144)
+++ trunk/blender/source/blender/render/intern/source/shadbuf.c	2013-04-18 16:26:58 UTC (rev 56145)
@@ -1394,7 +1394,6 @@
 		}
 		
 		lambda = min_ff(lambda_x, lambda_y);
-		if (lambda==lambda_o || lambda>=1.0f) break;
 		
 		zf= zf1 + lambda*(zf2-zf1);
 		count+= (float)shb->totbuf;
@@ -1410,6 +1409,8 @@
 				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;
 	}
 	
 	if (count!=0.0f) return (lightcount/count);

Modified: trunk/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadeoutput.c	2013-04-18 15:26:22 UTC (rev 56144)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c	2013-04-18 16:26:58 UTC (rev 56145)
@@ -181,7 +181,7 @@
 	double a, b, c, disc, nray[3], npos[3];
 	double t0, t1 = 0.0f, t2= 0.0f, t3;
 	float p1[3], p2[3], ladist, maxz = 0.0f, maxy = 0.0f, haint;
-	int snijp, do_clip = TRUE, use_yco = FALSE;
+	int cuts, do_clip = TRUE, use_yco = FALSE;
 
 	*intens= 0.0f;
 	haint= lar->haint;
@@ -244,7 +244,7 @@
 	b = nray[0] * npos[0] + nray[1] * npos[1] - nray[2]*npos[2];
 	c = npos[0] * npos[0] + npos[1] * npos[1] - npos[2]*npos[2];
 
-	snijp= 0;
+	cuts= 0;
 	if (fabs(a) < DBL_EPSILON) {
 		/*
 		 * Only one intersection point...
@@ -256,16 +256,16 @@
 		
 		if (disc==0.0) {
 			t1=t2= (-b)/ a;
-			snijp= 2;
+			cuts= 2;
 		}
 		else if (disc > 0.0) {
 			disc = sqrt(disc);
 			t1 = (-b + disc) / a;
 			t2 = (-b - disc) / a;
-			snijp= 2;
+			cuts= 2;
 		}
 	}
-	if (snijp==2) {
+	if (cuts==2) {
 		int ok1=0, ok2=0;
 
 		/* sort */




More information about the Bf-blender-cvs mailing list