Jump to content
  • Advertisement
Sign in to follow this  
Moolicious

z-buffer issues

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

At the moment I am busy creating a terrain editor for a possible game but I am having problems with z-buffering. My near clipping plane is 1.0f and my far clipping plane is 2000.0f (as I am using 1.0f to represent 1m in the world) and I am getting terrible clipping errors (when I use z-buffering) with objects as I move further away from the ground, the dams of water get horrible jagged edges on them and distort from well defined edges. I've been reading up about z-buffers and w-buffers to try solve the problem. I've used w-buffering instead of z-buffering and it solves the problem perfectly, but unfortunately none of my graphics cards support w-buffering (and they aren't old cards either), so I take a huge performance hit by using w-buffering. Apparently most cards only have z-buffering support. I do not want my game to fall back on software, so what can I do about it? How can I make z-buffering work for me? Any advice or link to some related info. would be much appreciated. Please don't refer me to DirectX SDK, that's where I've come from.

Share this post


Link to post
Share on other sites
Advertisement
Fix it! Only a few minutes after posting. :)
Anyways for anyone who is interested, I just needed to increase the precision of my z-buffer to 24bits, I originally set it to 16bits.

Share this post


Link to post
Share on other sites
I cant find the link atm (I'm at work), but there is a website that goes into the mathematics behind the Z-projection equations... it's a very interesting read. Maybe someone else can put up a link for it.

iirc, it has a calculation where you can feed in your near/far values and bit depth and it'll tell you what sort of resolution you can expect.

I'd try tweaking your projection values rather than rely on 24bit buffers, sure it's reasonably safe - but there's bound to be a few people out there with only 16-bit cards...

hth
Jack

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This one?
http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!