Please help me to resolve the following problem:
I have created a terrain using Triangle Strips and it is being rendered properly.
But when I add water ( QUAD with BLENDING enabled - ranging from one end of terrain to the other end, lies somewhere in the middle of the terrain in Y-direction ), the edges where water ( QUAD ) intersect the terrain starts shaking(i.e vibrating).
What could be the problem ?
By the way, this is what happens in the Render() function :
Render()
{
...
...
// Draw Terrain
glPushMatrix();
glScalef(10.0f, 2.0f, 10.0f);
Draw_Terrain_UsingTStrips();
glPopMatrix();
// Draw Translucent Quad for Water
glPushMatrix();
glEnable(GL_BLEND);
glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glColor4f(1.0f, 1.0f, 1.0f, 0.3f);
glBindTexture(GL_TEXTURE_2D, WATER_TEXTURE);
glScalef(15.0f, 1.0f, 15.0f);
glBegin(GL_QUADS);
T,V Pair for all the 4 Corners
glEnd();
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);
glPopMatrix();
...
...
}
Please note: I have scaled terrain & the QUAD for water(differently).
- I have used gluPerspective(45.0f, w/h, 0.1f, 20000);
- I also have the latest driver for my RivaTNT2 M64 (v 71.89 WHQL Certified)
Any suggestions ?