This is an extremely small feature that I figured out while trying to find the

waterwarp bug. This creates r_waterripple that causes a wave effect when
set to 1. Perhaps I will change it after release to adjust the size of the
waves...

-- Eric Windisch
This commit is contained in:
Eric Windisch 2000-01-12 02:24:09 +00:00
parent f36c52b978
commit b06d98de76
4 changed files with 16 additions and 1 deletions

View file

@ -101,6 +101,7 @@ cvar_t r_netgraph = {"r_netgraph","0"};
cvar_t r_fog = {"r_fog", "0"};
cvar_t r_volfog = {"r_volfog", "0"};
cvar_t r_waterwarp = {"r_waterwarp", "1"};
cvar_t r_waterripple = {"r_waterripple", "0"};
cvar_t gl_finish = {"gl_finish","0"};
cvar_t gl_clear = {"gl_clear","0"};

View file

@ -197,6 +197,7 @@ void R_Init (void)
Cvar_RegisterVariable (&r_fog);
Cvar_RegisterVariable (&r_waterwarp);
Cvar_RegisterVariable (&r_volfog);
Cvar_RegisterVariable (&r_waterripple);
Cvar_RegisterVariable (&gl_clear);
Cvar_RegisterVariable (&gl_texsort);

View file

@ -198,6 +198,7 @@ EmitWaterPolys ( msurface_t *fa ) {
float *v;
int i;
float s, t, os, ot;
vec3_t nv;
for (p=fa->polys ; p ; p=p->next) {
glBegin (GL_POLYGON);
@ -212,7 +213,18 @@ EmitWaterPolys ( msurface_t *fa ) {
t *= (1.0/64);
glTexCoord2f (s, t);
glVertex3fv (v);
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)
{
nv[2] = v[2] + 8*sin(v[0]*0.05+realtime)*sin(v[2]*0.05+realtime);
} else {
nv[2] = v[2];
}
glVertex3fv (nv);
}
glEnd ();
}

View file

@ -217,6 +217,7 @@ extern cvar_t r_netgraph;
extern cvar_t r_fog;
extern cvar_t r_waterwarp;
extern cvar_t r_volfog;
extern cvar_t r_waterripple;
extern cvar_t gl_clear;
extern cvar_t gl_cull;