[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12565] trunk/blender/source/blender/ render/intern/source/shadeoutput.c: Bugfix #7735

Ton Roosendaal ton at blender.org
Mon Nov 12 10:37:46 CET 2007


Revision: 12565
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12565
Author:   ton
Date:     2007-11-12 10:37:46 +0100 (Mon, 12 Nov 2007)

Log Message:
-----------
Bugfix #7735

Spothalo sometimes gave black pixels. Error was using floating point
32 bits precision checks where double should be used.

(10e-7 vs 10e-16)

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

Modified: trunk/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadeoutput.c	2007-11-12 09:12:37 UTC (rev 12564)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c	2007-11-12 09:37:46 UTC (rev 12565)
@@ -26,6 +26,7 @@
  */
 
 #include <stdio.h>
+#include <float.h>
 #include <math.h>
 #include <string.h>
 
@@ -195,7 +196,7 @@
 		maxz*= lar->sh_zfac;
 		maxy= lar->imat[0][1]*p1[0]+lar->imat[1][1]*p1[1]+lar->imat[2][1]*p1[2];
 
-		if( fabs(nray[2]) <0.000001f ) use_yco= 1;
+		if( fabs(nray[2]) < DBL_EPSILON ) use_yco= 1;
 	}
 	
 	/* scale z to make sure volume is normalized */	
@@ -210,7 +211,7 @@
 	c = npos[0] * npos[0] + npos[1] * npos[1] - npos[2]*npos[2];
 
 	snijp= 0;
-	if (fabs(a) < 0.00000001) {
+	if (fabs(a) < DBL_EPSILON) {
 		/*
 		 * Only one intersection point...
 		 */





More information about the Bf-blender-cvs mailing list