Applied raptor's r_waterwarp enable/disable patch. r_waterwarp now works

-- we still have to find the waterwarp bug, but this is a start.

Moved raptor's r_waterripple effect into #define _EXPERIMENTAL_ until
release. It doesn't break anything that we know of, but this is _still_ a
freeze we're in, and this is a new feature.
This commit is contained in:
Jeff Teunissen 2000-01-12 21:43:48 +00:00
parent a43852a7d7
commit 9bc10e5940
3 changed files with 13 additions and 7 deletions

View file

@ -386,6 +386,7 @@ void R_DrawSequentialPoly (msurface_t *s)
glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
glDisable (GL_BLEND);
}
//
@ -726,7 +727,7 @@ void R_BlendLightmaps (void)
{
// if (p->flags & SURF_UNDERWATER)
// DrawGLWaterPolyLightmap (p);
if (((r_viewleaf->contents==CONTENTS_EMPTY && (p->flags & SURF_UNDERWATER)) ||
if (r_waterwarp.value && ((r_viewleaf->contents==CONTENTS_EMPTY && (p->flags & SURF_UNDERWATER)) ||
(r_viewleaf->contents!=CONTENTS_EMPTY && !(p->flags & SURF_UNDERWATER)))
&& !(p->flags & SURF_DONTWARP))
DrawGLWaterPolyLightmap (p);
@ -786,7 +787,7 @@ void R_RenderBrushPoly (msurface_t *fa)
return;
}
if (((r_viewleaf->contents==CONTENTS_EMPTY && (fa->flags & SURF_UNDERWATER)) ||
if (r_waterwarp.value&&((r_viewleaf->contents==CONTENTS_EMPTY && (fa->flags & SURF_UNDERWATER)) ||
(r_viewleaf->contents!=CONTENTS_EMPTY && !(fa->flags & SURF_UNDERWATER)))
&& !(fa->flags & SURF_DONTWARP))
DrawGLWaterPoly (fa->polys);
@ -1284,7 +1285,7 @@ void R_RecursiveWorldNode (mnode_t *node)
// don't backface underwater surfaces, because they warp
// if ( !(surf->flags & SURF_UNDERWATER) && ( (dot < 0) ^ !!(surf->flags & SURF_PLANEBACK)) )
// continue; // wrong side
if ( !(((r_viewleaf->contents==CONTENTS_EMPTY && (surf->flags & SURF_UNDERWATER)) ||
if (r_waterwarp.value && !(((r_viewleaf->contents==CONTENTS_EMPTY && (surf->flags & SURF_UNDERWATER)) ||
(r_viewleaf->contents!=CONTENTS_EMPTY && !(surf->flags & SURF_UNDERWATER)))
&& !(surf->flags & SURF_DONTWARP)) && ( (dot < 0) ^ !!(surf->flags & SURF_PLANEBACK)) )
continue; // wrong side

View file

@ -198,7 +198,9 @@ EmitWaterPolys ( msurface_t *fa ) {
float *v;
int i;
float s, t, os, ot;
#ifdef _EXPERIMENTAL_
vec3_t nv;
#endif
for (p=fa->polys ; p ; p=p->next) {
glBegin (GL_POLYGON);
@ -214,17 +216,18 @@ EmitWaterPolys ( msurface_t *fa ) {
glTexCoord2f (s, t);
#ifdef _EXPERIMENTAL_
nv[0] = v[0]; //+ 8*sin(v[1]*0.05+realtime)*sin(v[2]*0.05+realtime);
nv[1] = v[1]; //+ 8*sin(v[0]*0.05+realtime)*sin(v[2]*0.05+realtime);
if(r_waterripple.value)
{
if(r_waterripple.value) {
nv[2] = v[2] + 8*sin(v[0]*0.05+realtime)*sin(v[2]*0.05+realtime);
} else {
nv[2] = v[2];
}
glVertex3fv (nv);
#else
glVertex3fv (v);
#endif // _EXPERIMENTAL_
}
glEnd ();
}

View file

@ -217,7 +217,9 @@ extern cvar_t r_netgraph;
extern cvar_t r_fog;
extern cvar_t r_waterwarp;
extern cvar_t r_volfog;
#ifdef _EXPERIMENTAL_
extern cvar_t r_waterripple;
#endif
extern cvar_t gl_clear;
extern cvar_t gl_cull;