Jump to content
  • Advertisement
Sign in to follow this  
Formski

Terrains and Depth Buffering

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

I currently have a terrain system working reasonably well based on GeoClipMaps, with a fixed plane of water at a certain Y value (Y being up in my coordinate system) My Near plane is at 1.0f and my Far plane at 200000.0f (am using Metres for my unit of measure, hence this value) I am getting very bad Z-fighting at longer distances. I have tried to linearize the Z-Buffer but run into the problem of the water plane disappearing beneath the 'terrain' plane that is underneath it. I've tried using a depth only pass and also a clipping plane for the terrain but I can't seem to fix this problem. Does anyone have any ideas or suggestions? Should I stick with linearized depth buffers or try to sort it out using a standard Z Buffer? Formski

Share this post


Link to post
Share on other sites
Advertisement
No - I just draw the plane as a set of rings getting further apart as it moves away from the viewer.

The problem is not just the terrain/water intersection...the terrain is appearing where the water should even over a body of water that has not terrain for miles and miles!

Formski

Share this post


Link to post
Share on other sites
Well, one thing that's obvious is that your z-buffer has a far/near ratio of 200k which seems like a lot. Have you tried increasing the near plane distance to something like 50 (I assume you need to be at some altitude to see as far as 200km)?

Another thing that'll screw things up is if your water plane is a single polygon. Any small errors in clipping and interpolation could make its apparent height vary a lot. This isn't z-fighting, but sounds similar to what you're seeing. There have been threads by others with this problem, who fixed it by making the water plane a mesh of smaller quads.

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!