Draw Order Issue

Started by
11 comments, last by ChristOwnsMe 11 years, 1 month ago

How big am I allowed to have my far plane without causing issues? My far plane right now is 40,000, and if I set it super low and get close to the sphere there doesn't seem to be issues.

Advertisement

It's not how big your far plane is but the ratio between your far plane and your near plane that matter. The easiest fix is to push your near plane out a little - if increasing it to say 10 or so resolves the issue, then you've just confirmed that a value of 1 is much too small for you.

There's a useful depth buffer precision calculator at http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html which will let you plug in some values and see how much precision you lose: with near 1 and far 30000 (and assuming a 24-bit depth buffer) the smallest depth separation you can resolve at the mid-range (15000) is a little over 13 units; increase near to 10 and this becomes 1.3 units - much better.

This, by the way, gets considerably worse if you're using a 16-bit depth buffer; with near 1 and far 30000 your smallest resolvable separation is now close to 2800 units!!! Quite nasty indeed.

So two main things here - firstly, prefer to use a 24-bit depth buffer (which shouldn't be a problem as all hardware from at least the past 10 years or more will support one), and get that near plane pushed out as far as you can reasonably tolerate it - you're very probably going to find that this will be a lot farther than you think right now.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks for the info and that calculator. I finally fixed the issue. Apparently I had a DepthBias set to 1 somewhere at some point. Thanks for all the help and information everyone.

This topic is closed to new replies.

Advertisement