Jump to content
  • Advertisement
Sign in to follow this  
michael879

holes in terrain

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

hey Im kinda new to directX and Im working on this simple terrain engine. I have some of it working, but when I try to render a terrain and move around in the world, holes appear in the terrain (and dissapear if I move again). I have a picture of it at www.kruskal.net/outcast/artifacts.bmp anyone know a way to fix this?

Share this post


Link to post
Share on other sites
Advertisement
Just off the top of my head and I am very tired so don't scream at me... Mipmap levels, texture coordinates. They go away if you pan left/right too (slowly, do they slowly disappear or pop?)

Share this post


Link to post
Share on other sites
Are you sure they are wholes. Looks like a ZBuffering problem to me. Like in the values are close to each other and might create artifacts like that. What are your near and far planes set at and are you clearing your depth buffer? Near and far planes should be set to 1.0f and 1000.0f respectively. Also have Direct3D handle your Depth/Stencil buffers such as creating a AutoDepthStencil buffer when you create your device.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
my near and far planes are 1 to 1000, but what do those have to do with the zbuffer? these things flash by as I move, they arent slow. I made sure to turn the z buffer on, but this does seem like a zbuffer problem..

Share this post


Link to post
Share on other sites
You sometimes get artifacts or weird anomolies from depth buffer issues. Are these artifacts only in the distance or do they appear near you? Give us a little more information. Your terrain seems to be rendering well except for those artifacts which brings me to the conclusion it might be a driver issue or something else.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Try running with the reference device, it will be ridiculously slow but as it's output should be 100% correct, you'll be able to tell if it's a driver issue.
It might be worth downloading the latest drivers if you haven't already.

Share this post


Link to post
Share on other sites

From the screenshot I can see that it is a horizontal line, with no relation to the triangles of the terrain. Is terrain rendering the only thing you do ?

Triangle indexing with bad indices may cause polygons to pop randomly.

Share this post


Link to post
Share on other sites
it I also noticed that those black lines dont seem to be on any triangle boundaries. All my program does is render the terrain and I know there are no bad indices, Ive checked that very carefully already. Ill try the reference device. Here is a much clearer picture of the artifacts which makes me think it is a zbuffer problem.
www.kruskal.net/outcast/artifacts2.bmp

Share this post


Link to post
Share on other sites

By looking at your last screenshot one could say that it is a z-buffer problem. Do you have your culling set correctly (ie. that you don't render back facing triangles) ?

Z-buffering artefacts usually "live" when the camera angle/position is changing.

Could you take a wireframe shot of the problem ? It might at least reveal if the problem is with Z-buffering.

Share this post


Link to post
Share on other sites
Hmm .. I think I've seen that before .. are you using Tri strips or Quads.

It's because of the way the triangles line up on the ridges of mountains, quads will start missing, triangles will just make it look jaggy.

Have you tried using both sorts of rendering?

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!