Sign in to follow this  
Formski

Terrains and Depth Buffering

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

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