PDA

View Full Version : Better depth buffer?



BwB
08-13-2000, 03:07 AM
Is there a way for me to make my zbuffer more accurate? I'm getting nasty artifacts at just over 1000 units away with polygons that are really close to each other (read as: up against each other). I tried using a 32bit zbuffer rather than a 16bit one and it made no difference. I need to keep a large depth range (30000.0-50000.0 far plane) because all of our world models are using 128 units per foot of virtual-space. Any ideas on what I'm doing wrong? or is that the best it gets? (I have a Viper II card)

Bob
08-13-2000, 04:23 AM
This kind of z-buffer artifact is not avoidable. It's there, but it's more or less visible. It has nothing to do with bad drivers nor a bad card. It's because of how the float work (with mantissa and exponent). The only way to (hmm, not gonna say 'avoid the problem') make the problem less visible, is to reduce the near to far ratio. This is done by either place the far plane closer (which is not an option as i understand from your post), or to place the near plane further away.

A good near to far ratio is 1e4 to 1e5 for 32-bit depthbuffer. Dunno for 16-bit, but i would guess not more than 1e4. This means that if you want far plane at 50.000, you need to place you near plane at 50 to keep a ratio of 1e4.

The less the ratio, the better precision you get (smaller articfacts).

BwB
08-13-2000, 05:57 AM
Thank you Bob, your a life saver! The artifacts are almost completely gone now!