Jump to content
  • Advertisement
Sign in to follow this  
kuroioranda

OpenGL Floating point 2D precision problems?

This topic is 4005 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

Hello all. I'm sure I'm just being a hypochondriac here, but it seemed like something to check before I get too far into this project. I'm looking to make a 2D, sprite and tile based game in OpenGL. I love OpenGL, it's fast and easy access to the hardware, but the single-precision float underpinnings to the engine have me a little worried. I know that the distribution for the real number values that can be represented by floating point values get much denser the closer to zero you are, and so I was wondering: for very large maps, how far away from zero do you have to go before you begin to see noticeable distortions in the size and shape of your sprites/tiles due to the real values you can represent with float getting sparser and sparser, assuming that your sprites are roughly 32x32 pixels?

Share this post


Link to post
Share on other sites
Advertisement
That was a very good read, and answers the question quite happily. So long as I stay under a millions units or so in any direction, my precision won't drop to the point of artifacting. That's actually pretty good, but it shouldn't be too hard for me to add some code so that points are clustered into localized groups, and then do my rendering relative to those localized centers.

Thanks for the link ^^!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!