R_View_UpdateEntityVisible();
}
-void R_SetupView(void)
+void R_SetupView(qboolean allowwaterclippingplane)
{
if (!r_refdef.view.useperspective)
GL_SetupView_Mode_Ortho(-r_refdef.view.ortho_x, -r_refdef.view.ortho_y, r_refdef.view.ortho_x, r_refdef.view.ortho_y, -r_refdef.farclip, r_refdef.farclip);
GL_SetupView_Orientation_FromEntity(&r_refdef.view.matrix);
- if (r_refdef.view.useclipplane)
+ if (r_refdef.view.useclipplane && allowwaterclippingplane)
{
// LordHavoc: couldn't figure out how to make this approach the
vec_t dist = r_refdef.view.clipplane.dist - r_water_clippingplanebias.value;
// GL is weird because it's bottom to top, r_refdef.view.y is top to bottom
qglViewport(r_refdef.view.x, vid.height - (r_refdef.view.y + r_refdef.view.height), r_refdef.view.width, r_refdef.view.height);CHECKGLERROR
- R_SetupView();
+ R_SetupView(true);
GL_Scissor(r_refdef.view.x, r_refdef.view.y, r_refdef.view.width, r_refdef.view.height);
GL_Color(1, 1, 1, 1);
GL_ColorMask(r_refdef.view.colormask[0], r_refdef.view.colormask[1], r_refdef.view.colormask[2], 1);
if (skyrendernow)
{
skyrendernow = false;
+ // we have to force off the water clipping plane while rendering sky
+ R_SetupView(false);
R_Sky();
+ R_SetupView(true);
// restore entity matrix
R_Mesh_Matrix(&rsurface.matrix);
}
R_Shadow_RenderMode_End();
}
-extern void R_SetupView(void);
+extern void R_SetupView(qboolean allowwaterclippingplane);
extern cvar_t r_shadows_throwdistance;
void R_DrawModelShadows(void)
{
R_Mesh_Draw(0, 4, 2, polygonelements, 0, 0);
// restoring the perspective view is done by R_RenderScene
- //R_SetupView();
+ //R_SetupView(true);
// restore other state to normal
R_Shadow_RenderMode_End();