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

Ton Roosendaal ton at blender.org
Thu Feb 3 17:31:04 CET 2011


Revision: 34628
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34628
Author:   ton
Date:     2011-02-03 16:31:03 +0000 (Thu, 03 Feb 2011)
Log Message:
-----------
Bugfix #25912

Render bug in spothalo (weird horizontal line).
Appeared to be precision error... even for doubles,
before doing division a check for FLT_EPSILON works
better than DBL_EPSILON (if there's an alternative).

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	2011-02-03 15:05:43 UTC (rev 34627)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c	2011-02-03 16:31:03 UTC (rev 34628)
@@ -154,8 +154,8 @@
 static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
 {
 	double a, b, c, disc, nray[3], npos[3];
-	float t0, t1 = 0.0f, t2= 0.0f, t3, haint;
-	float p1[3], p2[3], ladist, maxz = 0.0f, maxy = 0.0f;
+	double t0, t1 = 0.0f, t2= 0.0f, t3;
+	float p1[3], p2[3], ladist, maxz = 0.0f, maxy = 0.0f, haint;
 	int snijp, doclip=1, use_yco=0;
 	int ok1=0, ok2=0;
 	
@@ -202,7 +202,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]) < DBL_EPSILON ) use_yco= 1;
+		if( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1;
 	}
 	
 	/* scale z to make sure volume is normalized */	




More information about the Bf-blender-cvs mailing list