Re:“CPUs are optimized for video games”
by tgb on Wednesday August 10, 2016 @05:08PM
(#12264755)
My experience is that double precision is very common on demanding game areas, notably physics. I recall older versions of the ODE physics engine recommending and defaulting to double precision and lots of newbies on the forums being surprised there wasn't much performance difference. That was all some time ago.
[ Parent
| on HN ]
My experience is that it's extremely uncommon, including on physics systems. While I no longer work in games, I did for several years, I probably can count the times that I used double precision on one hand (if you exclude the JavaScript work that plagued the end of my game development career).
The reason for this is simple -- it's twice as slow. The vector width is half the size, and so you can do half as many operations at a time.
My experience is just as an amateur, so it's only worth so much. I'm pretty sure though that the difference was much less than a factor of two.
Re:“CPUs are optimized for video games”
by loup-vaillant on Thursday August 11, 2016 @12:56AM
(#12266353)
Probably because double precision floats are just as fast as single precisions if you don't vectorise. I bet you didn't.
This would also explain for instance why many programming languages drop single precision floats altogether: they don't plan to vectorize in the first place.
Yeah, it looks like ODE doesn't use SIMD or anything, and hence performs poorly compared to more modern engines: http://blog.wolfire.com/2010/03/Comparing-ODE-and-Bullet
A pretty solid rule of thumb is that 32 bits has enough precision for rendering, physics needs doubles if it's going to use a lot of iterations. Simplified models like Super Mario jumps or the tractor beam in "Thrust" (single rigid joint) can get away with 16-bit fixed point precision.
OTOH rendering of geometry only needs about as much precision as the display offers, which often means 8 bits on older hardware.