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

## 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 on other sites
i guess ur getting the problems where the water intersects the terrain? have u tried fading the water out at the edge (make it transparent)?

##### 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 on other sites
i dont quite understand... could u post a picture illustrating the problem?

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

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 22
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631766
• Total Posts
3002219
×