Re: Float versus double back

Board: Home Board index Raytracing General Development

(L) [2015/09/12] [ost by Geri] [Re: Float versus double] Wayback!

i use floats on most places, but some places, i use double, when i need to ensure precisity in some parts of the algo.

but i suggest you to use 32 bit integers instead, and 64 bit long longs, where it needed.
(L) [2015/10/16] [ost by mattpharr] [Re: Float versus double] Wayback!

>> JasonSmith wrote:I think I'll make this into one or more switches.  Thanks for both your replies.  

I've experienced precision issues in the past with objects far from the origin, or very strange in scale.  It will be good to have a way to test the difference in quality and speed.

I think this is an interesting question.  Anyone with more wisdom or experience, please share!
Something that helps with objects far from the origin is to transform the scene to camera space (i.e. where the camera is at the origin, generally looking down +z or -z). This places the highest fp precision close to the camera, where it's generally more useful.  (Consider, for example, a scene where the camera is at (10000,10000,10000) looking at an object at (10001, 10001, 10001); in camera space, the object is at (1,1,1), which is much better precision-wise.

Matt
(L) [2016/02/03] [ost by rouncer] [Re: Float versus double] Wayback!

64 bit is more for integers i think than decimals, but your stuck with a smaller scene with floating point values,  ive seen it myself, the camera starts shaking a bit when you go out of 32 bit range.
So sometimes i guess you need to.

back