Skip to content

Commit b372b5f

Browse files
committed
Fix r_forceAmbient comparison
r_forceAmbient ranges in [0.0; 0.3], while tmpAmbient is in range of [0; 255].
1 parent d46fb6f commit b372b5f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/engine/renderer/tr_bsp.cpp

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

4137-
if ( tmpAmbient[0] < r_forceAmbient.Get() &&
4138-
tmpAmbient[1] < r_forceAmbient.Get() &&
4139-
tmpAmbient[2] < r_forceAmbient.Get() ) {
4140-
VectorSet( tmpAmbient, r_forceAmbient.Get(), r_forceAmbient.Get(), r_forceAmbient.Get() );
4137+
const byte forceAmbientNormalised = floatToUnorm8( r_forceAmbient.Get() );
4138+
if ( tmpAmbient[0] < forceAmbientNormalised &&
4139+
tmpAmbient[1] < forceAmbientNormalised &&
4140+
tmpAmbient[2] < forceAmbientNormalised ) {
4141+
VectorSet( tmpAmbient, forceAmbientNormalised, forceAmbientNormalised, forceAmbientNormalised );
41414142
}
41424143

41434144
if ( tr.legacyOverBrightClamping )

0 commit comments

Comments
 (0)