mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-24 05:01:40 +00:00
OpenGL2: Remove and force r_softOverbright.
This commit is contained in:
parent
5fabc28dff
commit
3740c55dec
5 changed files with 7 additions and 44 deletions
|
@ -3013,37 +3013,14 @@ void R_SetColorMappings( void ) {
|
|||
int i, j;
|
||||
float g;
|
||||
int inf;
|
||||
int shift;
|
||||
|
||||
// setup the overbright lighting
|
||||
tr.overbrightBits = r_overBrightBits->integer;
|
||||
if ( !glConfig.deviceSupportsGamma ) {
|
||||
tr.overbrightBits = 0; // need hardware gamma for overbright
|
||||
}
|
||||
|
||||
// never overbright in windowed mode without soft overbright
|
||||
if ( !glConfig.isFullscreen && !r_softOverbright->integer )
|
||||
{
|
||||
tr.overbrightBits = 0;
|
||||
}
|
||||
|
||||
// never overbright with tonemapping
|
||||
if ( r_toneMap->integer && r_hdr->integer )
|
||||
{
|
||||
tr.overbrightBits = 0;
|
||||
}
|
||||
|
||||
// allow 2 overbright bits in 24 bit, but only 1 in 16 bit
|
||||
if ( glConfig.colorBits > 16 ) {
|
||||
if ( tr.overbrightBits > 2 ) {
|
||||
tr.overbrightBits = 2;
|
||||
}
|
||||
} else {
|
||||
if ( tr.overbrightBits > 1 ) {
|
||||
tr.overbrightBits = 1;
|
||||
}
|
||||
}
|
||||
if ( tr.overbrightBits < 0 ) {
|
||||
// allow 2 overbright bits
|
||||
if ( tr.overbrightBits > 2 ) {
|
||||
tr.overbrightBits = 2;
|
||||
} else if ( tr.overbrightBits < 0 ) {
|
||||
tr.overbrightBits = 0;
|
||||
}
|
||||
|
||||
|
@ -3063,14 +3040,6 @@ void R_SetColorMappings( void ) {
|
|||
|
||||
g = r_gamma->value;
|
||||
|
||||
shift = tr.overbrightBits;
|
||||
|
||||
// no shift with soft overbright
|
||||
if (r_softOverbright->integer)
|
||||
{
|
||||
shift = 0;
|
||||
}
|
||||
|
||||
for ( i = 0; i < 256; i++ ) {
|
||||
int i2;
|
||||
|
||||
|
@ -3088,7 +3057,7 @@ void R_SetColorMappings( void ) {
|
|||
} else {
|
||||
inf = 255 * pow ( i2/255.0f, 1.0f / g ) + 0.5f;
|
||||
}
|
||||
inf <<= shift;
|
||||
|
||||
if (inf < 0) {
|
||||
inf = 0;
|
||||
}
|
||||
|
|
|
@ -108,8 +108,6 @@ cvar_t *r_mergeLeafSurfaces;
|
|||
|
||||
cvar_t *r_cameraExposure;
|
||||
|
||||
cvar_t *r_softOverbright;
|
||||
|
||||
cvar_t *r_hdr;
|
||||
cvar_t *r_floatLightmap;
|
||||
cvar_t *r_postProcess;
|
||||
|
@ -1161,8 +1159,6 @@ void R_Register( void )
|
|||
r_greyscale = ri.Cvar_Get("r_greyscale", "0", CVAR_ARCHIVE | CVAR_LATCH);
|
||||
ri.Cvar_CheckRange(r_greyscale, 0, 1, qfalse);
|
||||
|
||||
r_softOverbright = ri.Cvar_Get( "r_softOverbright", "1", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
|
||||
r_hdr = ri.Cvar_Get( "r_hdr", "1", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_floatLightmap = ri.Cvar_Get( "r_floatLightmap", "0", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_postProcess = ri.Cvar_Get( "r_postProcess", "1", CVAR_ARCHIVE );
|
||||
|
|
|
@ -1765,8 +1765,6 @@ extern cvar_t *r_anaglyphMode;
|
|||
extern cvar_t *r_mergeMultidraws;
|
||||
extern cvar_t *r_mergeLeafSurfaces;
|
||||
|
||||
extern cvar_t *r_softOverbright;
|
||||
|
||||
extern cvar_t *r_hdr;
|
||||
extern cvar_t *r_floatLightmap;
|
||||
extern cvar_t *r_postProcess;
|
||||
|
|
|
@ -602,7 +602,7 @@ static void ComputeShaderColors( shaderStage_t *pStage, vec4_t baseColor, vec4_t
|
|||
}
|
||||
|
||||
// multiply color by overbrightbits if this isn't a blend
|
||||
if (r_softOverbright->integer && tr.overbrightBits
|
||||
if (tr.overbrightBits
|
||||
&& !((blend & GLS_SRCBLEND_BITS) == GLS_SRCBLEND_DST_COLOR)
|
||||
&& !((blend & GLS_SRCBLEND_BITS) == GLS_SRCBLEND_ONE_MINUS_DST_COLOR)
|
||||
&& !((blend & GLS_DSTBLEND_BITS) == GLS_DSTBLEND_SRC_COLOR)
|
||||
|
|
|
@ -449,7 +449,7 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
|
|||
|
||||
color[0] =
|
||||
color[1] =
|
||||
color[2] = (r_softOverbright->integer ? 1.0 : tr.identityLight) * backEnd.refdef.colorScale;
|
||||
color[2] = backEnd.refdef.colorScale;
|
||||
color[3] = 1.0f;
|
||||
GLSL_SetUniformVec4(sp, UNIFORM_BASECOLOR, color);
|
||||
|
||||
|
|
Loading…
Reference in a new issue