Skip to content

Commit 0741011

Browse files
committed
Fix r_forceAmbient comparison
1 parent f5ffb7f commit 0741011

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/engine/renderer/tr_bsp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,10 +4124,11 @@ void R_LoadLightGrid( lump_t *l )
41244124
tmpDirected[ 2 ] = in->directed[ 2 ];
41254125
tmpDirected[ 3 ] = 255;
41264126

4127-
if ( tmpAmbient[0] < r_forceAmbient.Get() &&
4128-
tmpAmbient[1] < r_forceAmbient.Get() &&
4129-
tmpAmbient[2] < r_forceAmbient.Get() ) {
4130-
VectorSet( tmpAmbient, r_forceAmbient.Get(), r_forceAmbient.Get(), r_forceAmbient.Get() );
4127+
const byte forceAmbientNormalised = floatToUnorm8( r_forceAmbient.Get() );
4128+
if ( tmpAmbient[0] < forceAmbientNormalised &&
4129+
tmpAmbient[1] < forceAmbientNormalised &&
4130+
tmpAmbient[2] < forceAmbientNormalised ) {
4131+
VectorSet( tmpAmbient, forceAmbientNormalised, forceAmbientNormalised, forceAmbientNormalised );
41314132
}
41324133

41334134
if ( tr.legacyOverBrightClamping )

0 commit comments

Comments
 (0)