Skip to content

Commit

Permalink
ref: gl: allow viewing water textures in their full glory with enable…
Browse files Browse the repository at this point in the history
…d r_ripple 2
  • Loading branch information
a1batross committed Oct 31, 2023
1 parent 2716e64 commit 4669dab
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ref/gl/gl_warp.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static struct
uint32_t texture[RIPPLES_TEXSIZE];
int gl_texturenum;
int rippletexturenum;
int texturescale; // not all textures are 128x128, scale the texcoords down
float texturescale; // not all textures are 128x128, scale the texcoords down
} g_ripple;

static qboolean CheckSkybox( const char *name, char out[6][MAX_STRING] )
Expand Down Expand Up @@ -1010,7 +1010,15 @@ void R_UploadRipples( texture_t *image )
return;

g_ripple.gl_texturenum = image->gl_texturenum;
g_ripple.texturescale = Q_max( 1, image->width / 64 );
if( r_ripple.value == 1.0f )
{
g_ripple.texturescale = Q_max( 1.0f, image->width / 64.0f );
}
else
{
g_ripple.texturescale = 1.0f;
}


pixels = (uint32_t *)glt->original->buffer;
wbits = MostSignificantBit( image->width );
Expand Down

0 comments on commit 4669dab

Please sign in to comment.