Skip to main content
gamedev.net
🔒 Locked

z-buffer issues

Started by Moolicious Nov 29, 2004 at 8:14 AM 4 replies 950+ views
Original Post
Moolicious
Moolicious
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.
Moolicious
Moolicious
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.
jollyjeffers
jollyjeffers
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
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
Moolicious
Moolicious
Thanks for the link, I always enjoy the extra material/mathematics behind the magic! :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.