Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


GLdoubles vs. GLfloats

This topic is 5483 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, if I''m running on a P4 system with a Geforce4MX, do I take a performance hit if I do all my OpenGL rendering using GLdoubles instead of GLfloats? The obvious answer used to be yes, but I thought operations on doubles on the P4 are actually faster than on floats because of the way that the data is shuffled around inside the processor. Is there any advantage in using GLdoubles for things like matrix calculations instead of GLfloats?

Share this post

Link to post
Share on other sites
I don''t see why you''d want to use doubles for graphics code. I''m pretty sure (almost 100%) that the data that actually gets submitted to the graphics card is converted to single-floats, short ints and bytes, so the only advantage you''re seeing is (at best) matrix concatenation, because the vertices get multiplied with the modelview*projection matrix on the GPU nowadays, and that is using single-precision floats.
However, if you are multiplying many matrices together, and suffer from lack of precision, multiply the matrices together, convert the result to a single-precision-float-based matrix and upload that to the card.
Even if you''re not doing vertex transformation in hardware (e.g. custom-written vertex shaders; the ones in the NVidia driver use singles as far as I know), there''s not an awful amount of point in using doubles, as the precision gain is absolutely minimal, and once again, you need to cast to single precision anyway.

- JQ

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!