Skip to content

Commit 1559cbc

Browse files
committed
renderer: disable GLSL overbright on fullbright lightmode globally instead of doing it per-texture
It fixes rendering fullbright lightmap stages when light mode is not fullbright, like the starchart512 hologram in procyon map.
1 parent a97c269 commit 1559cbc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/engine/renderer/tr_bsp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5179,9 +5179,9 @@ void RE_LoadWorldMap( const char *name )
51795179
}
51805180
}
51815181

5182-
/* Used in GLSL code for the GLSL implementation
5183-
without color clamping and normalization. */
5184-
if ( !tr.legacyOverBrightClamping )
5182+
/* Set GLSL overbright parameters if the legacy clamped overbright isn't used
5183+
and the lighting mode is not fullbright. */
5184+
if ( !tr.legacyOverBrightClamping && tr.lightMode != lightMode_t::FULLBRIGHT )
51855185
{
51865186
tr.mapLightFactor = pow( 2, tr.mapOverBrightBits );
51875187
tr.mapInverseLightFactor = 1.0f / tr.mapLightFactor;

src/engine/renderer/tr_shade.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ void Render_lightMapping( shaderStage_t *pStage )
11281128
// u_InverseLightFactor
11291129
/* HACK: use sign to know if there is a light or not, and
11301130
then if it will receive overbright multiplication or not. */
1131-
bool cancelOverBright = pStage->cancelOverBright || lightMode == lightMode_t::FULLBRIGHT;
1131+
bool cancelOverBright = pStage->cancelOverBright;
11321132
float inverseLightFactor = cancelOverBright ? tr.mapInverseLightFactor : -tr.mapInverseLightFactor;
11331133
gl_lightMappingShader->SetUniform_InverseLightFactor( inverseLightFactor );
11341134

0 commit comments

Comments
 (0)