This is code for ezQuake, adapted from my netQuake engine Qrack (http://www.quakeone.com/qrack)
thought Jonny_Z might like this...
file gl_rmain.c
in R_DrawAliasModel
add..
right before this..
Just simple eyecandy that doesnt hinder gameplay...
Though, this exact method CAN be used to create a glowing fullbright texture over a player if they have Quad or Pent
thought Jonny_Z might like this...
file gl_rmain.c
in R_DrawAliasModel
add..
// #define ISUNDERWATER(x) ((x) == CONTENTS_WATER || (x) == CONTENTS_SLIME || (x) == CONTENTS_LAVA)
if ((gl_caustics.value) && (underwatertexture && gl_mtexable && ISUNDERWATER(TruePointContents(ent->origin))))
{
GL_EnableMultitexture ();
glBindTexture (GL_TEXTURE_2D, underwatertexture);
glMatrixMode (GL_TEXTURE);
glLoadIdentity ();
glScalef (0.5, 0.5, 1);
glRotatef (realtime * 10, 1, 0, 0);
glRotatef (realtime * 10, 0, 1, 0);
glMatrixMode (GL_MODELVIEW);
GL_Bind (underwatertexture);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR);
glEnable (GL_BLEND);
R_SetupAliasFrame (oldframe, frame, paliashdr, true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND);
GL_SelectTexture(GL_TEXTURE1_ARB);
glTexEnvi (GL_TEXTURE_ENV, GL_RGB_SCALE, 1);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glDisable (GL_TEXTURE_2D);
glMatrixMode (GL_TEXTURE);
glLoadIdentity ();
glMatrixMode (GL_MODELVIEW);
GL_DisableMultitexture ();
}
if ((gl_caustics.value) && (underwatertexture && gl_mtexable && ISUNDERWATER(TruePointContents(ent->origin))))
{
GL_EnableMultitexture ();
glBindTexture (GL_TEXTURE_2D, underwatertexture);
glMatrixMode (GL_TEXTURE);
glLoadIdentity ();
glScalef (0.5, 0.5, 1);
glRotatef (realtime * 10, 1, 0, 0);
glRotatef (realtime * 10, 0, 1, 0);
glMatrixMode (GL_MODELVIEW);
GL_Bind (underwatertexture);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR);
glEnable (GL_BLEND);
R_SetupAliasFrame (oldframe, frame, paliashdr, true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND);
GL_SelectTexture(GL_TEXTURE1_ARB);
glTexEnvi (GL_TEXTURE_ENV, GL_RGB_SCALE, 1);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glDisable (GL_TEXTURE_2D);
glMatrixMode (GL_TEXTURE);
glLoadIdentity ();
glMatrixMode (GL_MODELVIEW);
GL_DisableMultitexture ();
}
right before this..
...
glShadeModel (GL_FLAT);
if (gl_affinemodels.value)
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glPopMatrix ();
...
glShadeModel (GL_FLAT);
if (gl_affinemodels.value)
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glPopMatrix ();
...
Just simple eyecandy that doesnt hinder gameplay...
Though, this exact method CAN be used to create a glowing fullbright texture over a player if they have Quad or Pent