Jump to content
  • Advertisement
Sign in to follow this  
Magnumwolf

Rendering problem with terrain mesh

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

Im having a weird problem with my terrain meshes in Direct3D, I have 1 terrain mesh for the land and 1 for the water but there seems to be a problem with the rendering order Ive made a screenshot to show the problem http://img215.imageshack.us/img215/740/terrainproblem.jpg This screenshot show what happens when i run the game on my home computer, I tried running it on a different computer at Uni and it all rendered fine. One of the stranger problems is that if i run the same setup through XNA it renders fine on my home PC. Does anyone know what could be causing this and how i might fix it? Thanks for your help Magnumwolf

Share this post


Link to post
Share on other sites
Advertisement
This is known as Z-fighting, and happens when the depth buffer doesn't have enough precision to correctly tell the water and the terrain apart. How do you set up your device?
Make sure to request a 24 bit depth buffer (or even 32 bit if supported). It is also important to set your projection matrix correctly, what is your near and far plane?
Keeping the near plane too near, or the far plane too far, makes these problems much worse. Set the near clipping plane as far away as possible, and the far plane as close as possible.

Share this post


Link to post
Share on other sites
Try 1 or 10 for Near Clip.
The z buffer settings are set when you are creating the D3D9 device.There are format types like D24S8 which creates a 24bit depth buffer and 8 bit stencil buffer etc.

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!