PDA

View Full Version : Water Surface Problem



gunsboy
11-18-2002, 05:12 AM
I am creating a transparent water surface on a 3D texture covered terrain.

Everything looks fine until I start rotating and moving around in the terrain. The areas that are on the water surface level flicker alot. It looks like big random chunks of it go under the water surface and then above it. I was looking for information about Z-Buffer and that the textures are fighting for the Z-Buffer, but no luck ..

Can you suggest something please ..

chowe6685
11-18-2002, 05:19 AM
you probably have a depth buffer precision issue. There are three solutions. One is to increase the number of bits, try switching from 16 to 32 bit color if possible. Another is to pull in the far clipping plane and the third is to bump out the near clipping plane. If you can afford to its probably best just to bump the near plane out

gunsboy
11-18-2002, 05:26 AM
Originally posted by chowe6685:
you probably have a depth buffer precision issue. There are three solutions. One is to increase the number of bits, try switching from 16 to 32 bit color if possible. Another is to pull in the far clipping plane and the third is to bump out the near clipping plane. If you can afford to its probably best just to bump the near plane out

In the program I'm using
gluPerspective(45, (float) width()/height(), m_radius/100, m_radius*10000);
so
near = m_radius/100;
far = m_radius*10000;
where
m_radius = max((maxX-minX),(maxY-minY));

So you are saying that I should pump the near higher ?

Bob
11-18-2002, 06:25 AM
Remove "/100" from your near plane calculation and somewhat better depth buffer precision. If you have a 16 bit depth buffer, you better replace if with "*10" or so instead.

gunsboy
11-18-2002, 09:01 AM
Thanks alot for the tips .. I can't set the depth buffer bit size .. I'm using QT. And it is set to 1.