diff options
author | Ton Roosendaal <ton@blender.org> | 2011-02-03 19:31:03 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-02-03 19:31:03 +0300 |
commit | 54aa4fa3a2bfcc941a58b0a97ecd0f1d6d3c56e0 (patch) | |
tree | 5c8249c5c7dcaac7ff03c451a543ad54b1cc9f11 /source/blender/render | |
parent | 6a23716957db25021fec3444057026e8bc57c387 (diff) |
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).
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 7993abc85a1..5b91f6ab08f 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -154,8 +154,8 @@ float mistfactor(float zcor, float *co) 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 @@ 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]) < DBL_EPSILON ) use_yco= 1; + if( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1; } /* scale z to make sure volume is normalized */ |