mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-24 05:44:16 +00:00
ref: gl: fix overbrights with VBO
This commit is contained in:
parent
371025dc8e
commit
c9d29b3955
@ -1003,11 +1003,22 @@ void R_GammaChanged( qboolean do_reset_gamma )
|
||||
|
||||
static void R_CheckGamma( void )
|
||||
{
|
||||
qboolean rebuild = false;
|
||||
|
||||
if( FBitSet( gl_overbright.flags, FCVAR_CHANGED ))
|
||||
{
|
||||
R_GammaChanged( false );
|
||||
rebuild = true;
|
||||
ClearBits( gl_overbright.flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
||||
if( gl_overbright.value && FBitSet( r_vbo.flags, FCVAR_CHANGED ))
|
||||
{
|
||||
rebuild = true;
|
||||
ClearBits( r_vbo.flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
||||
if( rebuild )
|
||||
R_GammaChanged( false );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -749,7 +749,7 @@ static void R_BuildLightMap( msurface_t *surf, byte *dest, int stride, qboolean
|
||||
tmax = ( info->lightextents[1] / sample_size ) + 1;
|
||||
size = smax * tmax;
|
||||
if( gl_overbright.value )
|
||||
lightscale = 256;
|
||||
lightscale = r_vbo.value ? 171 : 256;
|
||||
else lightscale = ( pow( 2.0f, 1.0f / v_lightgamma->value ) * 256 ) + 0.5;
|
||||
|
||||
lm = surf->samples;
|
||||
@ -2217,17 +2217,22 @@ static void R_SetLightmap( void )
|
||||
if( mtst.skiptexture )
|
||||
return;
|
||||
|
||||
/*if( gl_overbright->integer )
|
||||
if( gl_overbright.value )
|
||||
{
|
||||
// GLfloat color[4] = { 128.0f / 192.0f, 128.0f / 192.0f, 128.0f / 192.0f, 1.0f };
|
||||
|
||||
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB );
|
||||
pglTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE );
|
||||
pglTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB );
|
||||
pglTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE );
|
||||
pglTexEnvi( GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2 );
|
||||
|
||||
// doesn't work here for some reason
|
||||
// pglTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color );
|
||||
}
|
||||
else*/
|
||||
else
|
||||
{
|
||||
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
|
||||
}
|
||||
pglTexCoordPointer( 2, GL_FLOAT, sizeof( vbovertex_t ), (void*)offsetof(vbovertex_t, lm_tc ) );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user