I'm having trouble with water opacity and reflection at the same time...
I can do them apart but not at the same time.
GLvoid DrawGLScene(GLvoid){
float look[3] = {0.0,0.0,0.0};
double eqr[] = {0.0f,0.0f, -1.0f, 0.0f}; // Plane Equation To Use For The Reflected Objects
glClearColor(0.0f,0.0f,0.0f,1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
glLoadIdentity();
add_vector(default_player->dir,look);
add_vector(default_player->cam,look);
gluLookAt(default_player->cam[0], default_player->cam[1], default_player->cam[2], look[0], look[1], look[2], 0, 0, 1);
glEnable(GL_STENCIL_TEST);
glColorMask(0,0,0,0);
glDisable(GL_DEPTH_TEST);
glStencilFunc(GL_ALWAYS, 1, 1);
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
RenderWater();
glColorMask(1,1,1,1);
glEnable(GL_DEPTH_TEST);
glStencilFunc(GL_EQUAL, 1, 1);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
/* DRAW */
glEnable(GL_CLIP_PLANE0);
glClipPlane(GL_CLIP_PLANE0, eqr);
glPushMatrix();
glScalef(1.0f, 1.0f, -1.0f);
glLightfv(GL_LIGHT1, GL_POSITION,default_player->light_pos);
gl_all_textures(hash_tex, default_player,map,1); /* terrain */
glPopMatrix();
glDisable(GL_CLIP_PLANE0);
glDisable(GL_STENCIL_TEST);
glLightfv(GL_LIGHT1, GL_POSITION,default_player->light_pos);
RenderSky();
RenderText();
RenderWater(); /* reflection working but no opactity */
gl_all_textures(hash_tex, default_player,map,0); /* terrain */
// RenderWater(); /* opacity working but no reflection */
glutSwapBuffers();
}

my goal is something like this:






