Sign in to follow this  
akira32

How to solve z-fighting problem

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this