Jump to content
  • Advertisement

Archived

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

Shooter

Z-Buffer problems

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

Hi, I''ve got some trouble with my DirectX 8.1 application: I am drawing some blocks, but their surfaces are overlapping sometimes. So, I decided to use a z-buffer to solve this problem, but it does not work that good: The surfaces do not appear any more, there are only some single pixels visible. What went wrong? I don''''t need any signature ;-)

Share this post


Link to post
Share on other sites
Advertisement
Take a close look at the near and far clipping planes of your view frustum. Make sure the blocks you are rendering fall within them. Right now it sounds like the two planes are really close together and you are seeing a small section of your blocks between them?

Share this post


Link to post
Share on other sites
Also check
SetRenderState( D3DRS_ZFUNC, .....);

Make sure you set the correct Z buffer comparison function.

Might be that you have set it to D3DCMP_LESS, but you really should have set D3DCMD_GREATER.


Hope this helps

Share this post


Link to post
Share on other sites
I solved the problem on my own - I forgot to set the appropriate flag in the Clear() function.

I don''''t need any signature ;-)

Share this post


Link to post
Share on other sites

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