This topic is now archived and is closed to further replies.

Z Buffer artifacts

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

Have you tried using z-bias? In D3D, this is set by the D3DRENDERSTATE_ZBIAS render state.

As for W-buffering, I know that Voodoo 2's and 3's, TNT 2's, and GeForce 256's have it for sure.

Share this post

Link to post
Share on other sites
Hi everyone,
I'm working on a 3d engine that renders a heightfield. The height field contains data about the ground below the sea level, and above. I want to render a flat alpha plane right at sea level (the water). It works ok, but only at close distances. Even with a 32 bit zbuffer I get Z-fighting between the water and the land. On my velocity card's 16 bit z buffer it's much worse. My question is twofold: First, I guess this is a precision problem - a 16 bit value can only hold so much precision, and these artifacts must be where the two values being compared are so close that it's random which one wins. My viewport extends out for 40000 units (we'll call them meters). Another thing that happens is that the artifacting becomes worse the further I move from 0,0,0. This program uses a huge world several hundred miles across. Anyway, what if I divided everything by 10, or 100? Anyone know offhand if that would make a difference?
Second, I bet W buffering would fix this, but does anyone know if this is a rare feature, or one that is becoming common in newer cards? This velocity card supports it, but my G400 doesn't, so who knows.
I guess a third option would be (assuming the camera is above the water) to draw the underwater part, then the water, then the above water parts, but this would require a big change in the way the land is stored, and I'd like to keep the nice neat heightfield format.
Thanks in advance for any comments!

Share this post

Link to post
Share on other sites