Jump to content
  • Advertisement
Sign in to follow this  
akira32

How to solve z-fighting problem

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

How to solve z-fighting problem? (VC++ with DirectX 9) I record a video about my scene in the website: http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/MapEditor%202008-10-08%2015-46-37-59.avi Can I use the certain SetRenderState to solve the z-fighting problem?

Share this post


Link to post
Share on other sites
Advertisement
Increase the size of your depth buffer.

You probably have something like this in your code.


d3dpresentparams.EnableAutoDepthStencil = TRUE;
d3dpresentparams.AutoDepthStencilFormat = D3DFMT_D16;



Replace with...


d3dpresentparams.EnableAutoDepthStencil = TRUE;
d3dpresentparams.AutoDepthStencilFormat = D3DFMT_D24;



If you're card supports it, you can go up to D3DFMT_D32

Share this post


Link to post
Share on other sites

In addition to increasing precesion, you might also want to check out this article which covers much of the details involved and general tips for solving depth fighting.

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!