mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2025-02-21 02:50:56 +00:00
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:
parent
a43852a7d7
commit
9bc10e5940
3 changed files with 13 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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 ();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue