PDA

View Full Version : floats or integers



mms
03-29-2001, 12:19 AM
is there any difference between computing everything in integer numbers or floats in OpenGL ?
i'm asking about this because yet 8 years ago that was the only way to make something good with 3D... at that time using floats was strongly unrecommended... that was the time of lots of ASM tricks and now ?? is there any 3D game programmer who minds using ints or not ?

thanks for an aanswer...

Sansus
03-29-2001, 05:44 AM
The time for ASM has passed and the power of the hardware nowadays allows you to use floating point types. I use floats in a big part of my engine, and I looked other engines and they use float types too. Floating types will give you more level of accuracy than integers. So, use it if you need it. But don't use double types!!!!

Sansus
03-29-2001, 05:48 AM
The time for ASM has passed and the power of the hardware nowadays allows you to use floating point types. I use floats in a big part of my engine, and I looked other engines and they use float types too. Floating types will give you more level of accuracy than integers. So, use it if you need it. But don't use double types!!!!

Tim Stirling
03-29-2001, 08:22 AM
Doubles can be just as fast as floats at times, sometimes faster because in some functions the values are converted to doubles and then computed. However some functions like SQRTs and trig will be a lot slower if u use doubles as they are iterative. Sticking to floats should be fine for most things though.

Tim http://www.opengl.org/discussion_boards/ubb/smile.gif