Page 2 of 2

Re: Float versus double

Posted: Sat Sep 12, 2015 2:21 pm
by Geri
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.

Re: Float versus double

Posted: Fri Oct 16, 2015 4:00 pm
by mattpharr
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

Re: Float versus double

Posted: Wed Feb 03, 2016 5:37 pm
by rouncer
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.