Jump to content
  • Advertisement
Sign in to follow this  
Scet

[solved] My triangles are hurting eachother, z-fighting problems

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

OK I'm having this problem where when I move through the level, triangles disappear or get "cut up" or jump infront of others. I have the Z-buffer enabled and I am clearing it each frame. I tried turning on culling, clipping and setting the depth-bias, but those didn't do much of anything. See the "split" in the blue-grey quad(it's just two triangles, the whole level is one big triangle list), as I move so does the "split" or the quad will just disappear altogether. Has anybody had this problem or does anyone have the solution? People aren't going to play DOOM.Net if it slices the level [sad] [Edited by - Scet on April 23, 2006 8:21:35 AM]

Share this post


Link to post
Share on other sites
Advertisement
Classic problem unfortunately - "Z Fighting" (or sometimes "flimmering"). It happens when you have coplanar geometry that generates the same Z value. Due to various floating point errors/rounding you can get strange patterns where the "in front" polygon will change...

Best bet is to try and seperate those polygons - move them further apart, or possibly cull the one that should actually be behind the other.

Other possibilities are to increase the Z resolution (e.g. a 24 or 32 bit depth buffer instead of 16) or to tweak the projection matrix - try and make the difference between Z-Near and Z-Far as small as possible.

Depth bias should sort this out, but getting that working can be a little tricky - you need to split/change the bias between the two coplanar sets of geometry, but getting all hardware to work the same way can be difficult (even though the D3D9 changes are supposed to solve that)...

hth
Jack

Share this post


Link to post
Share on other sites
Make sure you near clipping plane value is not too small and you far clipping plane value is not too big.
You can find this values in your projection matrix.

[edit] beaten again.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kamikaze15
Make sure you near clipping plane value is not too small and you far clipping plane value is not too big.
You can find this values in your projection matrix.


This was actually the problem it seems. I had far clipping plane set to 10000 so I could see the whole level, but it murdered things up close. Setting it < 2000 seems to fix it.

Thanks for the help guys.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!