Browse Source

ref: gl: fix overbrights with VBO

pull/2/head
Alibek Omarov 12 months ago
parent
commit
c9d29b3955
  1. 13
      ref/gl/gl_rmain.c
  2. 13
      ref/gl/gl_rsurf.c

13
ref/gl/gl_rmain.c

@ -1003,11 +1003,22 @@ void R_GammaChanged( qboolean do_reset_gamma ) @@ -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 );
}
/*

13
ref/gl/gl_rsurf.c

@ -749,7 +749,7 @@ static void R_BuildLightMap( msurface_t *surf, byte *dest, int stride, qboolean @@ -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 ) @@ -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…
Cancel
Save