Sign in to follow this  

Rendering Problem...

This topic is 4415 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 have been trying to add water to a landscape engine I am making, but I am getting a strange effect when I render it. Does anyone have any idea what this is and where I can find information on how to fix it? http://hcmd.no-ip.org/users/chris/HostedImages/EternalLiberty5_1_A2_CMP.jpg

Share this post


Link to post
Share on other sites
Why there is a sawtooth at the edge. I put a random texture on the water because the normal one was mostly transparent.

The land is made up of a 32x32 grid, and the water is one large plane.

Share this post


Link to post
Share on other sites
Don't just increase z-buffer precision. It's not ok that this happens with a 16-bit z-buffer. Move the near clipping plane further and this will drastically improve z precision.

Share this post


Link to post
Share on other sites
The precision is biased towards the near plane. So moving the far plane closer increases the precision of the z-buffer a bit, while moving the near plane towards the far plane greatly increases the precision of the z-buffer.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It's somewhat complicated but go through the math properly and you will see the problem. In any case, push the near plane as far from the camera as you can before it starts clipping into objects. This will leave more bits for actual Z values instead of wasting them on the air 1mm from the camera. Precision is higher closer to the camera so you can really waste a LOT of bits by putting the near plane too close to 0.

Share this post


Link to post
Share on other sites
Quote:
Original post by IceSynth
How does the near clipping plane affect the precision?
Read this for a good description of how the depth buffer works. It is technically about OpenGL, but the principle's are universal.

Share this post


Link to post
Share on other sites
Thanks for all your help, I really appreciate it. Moving the clipping planes from Near: 0.001f and Far: 64000 to where they really needed to be helped a lot. I guess when I set up the camera, I was looking for an easy way to make sure everything got rendered.

Share this post


Link to post
Share on other sites

This topic is 4415 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.

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