PDA

View Full Version : How to solve this problem?



jamesclarke
04-07-2004, 06:45 AM
Hi friends, when I was programming, I encountered a problem in rendering, just like this picture: http://www.eshelps.com/web/personal/jamesclarke/2.jpg
Water surface mixes with the terrain bringing sawtooth. How can I solve this problem?

Bob
04-07-2004, 06:54 AM
Push the near clip plane as far out as you can possibly accept. Clicky (http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html) for more information.

04-11-2004, 05:14 AM
Thanks, but after I pushed the near clip plane further, I still found the problem like this :

http://www.eshelps.com/web/personal/jamesclarke/3.jpg

I set the projection even as:
gluPerspective(45.0f,(GLfloat)m_recOld.right/(GLfloat)m_recOld.bottom,100.0f,5000.0f);
And because of magnification, now the height of the terrain is about 400. The Z of View point is around 430.So where the problem lies?

Honk
04-11-2004, 08:13 AM
The problem is still the same: limited z-buffer precision.

The best solution is to make sure that the terrain intersects with the water at an angle no less then 20 degrees.

At least it worked for me.

04-11-2004, 03:25 PM
What precision depth buffer are you asking for? Are you actually getting it?

If possible, ask for a larger depth buffer on your rendering surface.