diff options
author | Ton Roosendaal <ton@blender.org> | 2007-11-12 12:37:46 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-11-12 12:37:46 +0300 |
commit | da7175476daed72841059d6aacb7bf25e991b7e0 (patch) | |
tree | 0a7147a5a3a56b6b301976e5d662f966f1ec421a /source/blender/render | |
parent | 7c717db075f3980b81f753404749305e12b9e216 (diff) |
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)
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index f50028e4c83..82feafb96d7 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -26,6 +26,7 @@ */ #include <stdio.h> +#include <float.h> #include <math.h> #include <string.h> @@ -195,7 +196,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) 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 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) 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... */ |