mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-25 13:21:04 +00:00
fix the r_wateralpha not working without r_volfog bug. Unfortunatly, this doesn'
t do anything for the r_wateralpha bug that allows cheating (no diff what so eve r).
This commit is contained in:
parent
bc7c094a33
commit
451b4056a4
1 changed files with 16 additions and 4 deletions
|
@ -1081,12 +1081,12 @@ R_RenderView ( void ) {
|
|||
//glEnable(GL_STENCIL_TEST);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LESS);
|
||||
glFogi (GL_FOG_MODE, GL_EXP2);
|
||||
glFogfv (GL_FOG_COLOR, colors);
|
||||
glFogi (GL_FOG_MODE, GL_EXP2);
|
||||
glFogfv (GL_FOG_COLOR, colors);
|
||||
// fixme: GL_FOG_DENSITY should have r_volfog_density var
|
||||
glFogf (GL_FOG_DENSITY, r_volfog->value);
|
||||
glFogf (GL_FOG_DENSITY, r_volfog->value);
|
||||
|
||||
glEnable(GL_FOG);
|
||||
glEnable(GL_FOG);
|
||||
R_DrawWaterSurfaces();
|
||||
glDisable(GL_FOG);
|
||||
|
||||
|
@ -1122,7 +1122,19 @@ else
|
|||
{
|
||||
R_RenderScene ();
|
||||
R_DrawViewModel ();
|
||||
if (r_wateralpha->value<1.0) {
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
glStencilFunc(GL_ALWAYS, 1, 1);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LESS);
|
||||
}
|
||||
R_DrawWaterSurfaces ();
|
||||
if (r_wateralpha->value<1.0) {
|
||||
glStencilFunc(GL_EQUAL, 1, 1);
|
||||
glStencilMask(GL_FALSE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
|
||||
R_PolyBlend ();
|
||||
|
|
Loading…
Reference in a new issue