Re:Why floats suck - accurate galaxy-wide coordinates in 128...
by stcredzero on Monday May 02, 2011 @02:49PM
(#2507372)
Yeah. I've also tried a galactic simulation game and ran into the limitations of floats. 32 bit floats only give you a usable resolution of 1 in 100000 for global coords. Even doubles are too small. This becomes an issue if you want to zoom from local ship view out to the local planetary body. You end up having to do goofy things like make a scaled billboard out of the nearby planets and place them far enough away that nobody notices.
[ Parent
| on HN ]
Re:Why floats suck - accurate galaxy-wide coordinates in 128...
by marshray on Monday May 02, 2011 @05:46PM
(#2507995)
I think we can conclude that galactic simulation games are probably a special case for which 128 bit integer coordinates make sense.
Once you've subtracted out the offset of your spaceship though, everything you view from there is easier done with float or double.
Re:Why floats suck - accurate galaxy-wide coordinates in 128...
by stcredzero on Monday May 02, 2011 @08:25PM
(#2508481)
Of course, in particular since in most cases, one must communicate with the GPU using 32 bit floats. (I'm going to guess that this is changing, though.)
Re:Why floats suck - accurate galaxy-wide coordinates in 128...
by marshray on Monday May 02, 2011 @08:59PM
(#2508567)
Yes, the recent generation of Nvidia GPUs has added hardware support for doubles. This was done to be able to sell hardware for use in financial analysis rather than any use in graphics.
Re:Why floats suck - accurate galaxy-wide coordinates in 128...
by stcredzero on Monday May 02, 2011 @09:38PM
(#2508652)
The Panda3D Python library uses double-precision floats, due to it's being a Python library. Currently, these are converted to 32 bit floats which are then sent to the GPU.