Jump to content
  • Advertisement
Sign in to follow this  
polar01

OpenGL OpenGL/Video card precision

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

Hi,

Here we are drawing micro shapes for electronics, we currently use a floating point precision of 1e-04f, under this limit we draw nothing.

But it is too big for us, in some model we loose some information.

Do you have experience with floating point precision on video card with OpenGL ?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
Why don't you just rescale things? OpenGL units aren't a fixed size.

You should get about seven places of precision out of the floating point numbers; which is a largest:smallest ratio of about ten million.

The smallest objects you have might well only be 1/10000th metre scale, but you're probably not also using anything larger than 100m at the same time...

Share this post


Link to post
Share on other sites
Thanks,

Currently our shape lenght is lower than 1e-5 and floating point precision as specified in the OpenGL specification is at least 1e-5 (But can be more).

So it depend of the OpenGl implementation !

In fact we should use a transformation and the a lenght... but for this software version it is too late.

Thans

Share this post


Link to post
Share on other sites
You should check the parts of the GL specification relating to rasterization.

Your shapes either overlap with pixels, or they don't. If you're drawing polygons between pixels, they'll be invisible no matter how precise the floating-point math is.
If you need sub-pixel accuracy, you could use a super-sampling technique.

Share this post


Link to post
Share on other sites
Thanks,

I just need to draw very small shapes and being able to zoom on it. when I zoom, I see it.

The problem is that the shape coordinates are rescaled by a factor (ex : 1/10000) and then we use OpenGL to draw it.

We should use glScale(1/10000) and the draw it ! ... but for now it is too late for the current release (too much changes and tests are required) and so I try to find the best temporary method.

Thx

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!