Skip to content

Commit

Permalink
Fix r_forceAmbient comparison
Browse files Browse the repository at this point in the history
r_forceAmbient ranges in [0.0; 0.3], while tmpAmbient is in range of [0; 255].
  • Loading branch information
VReaperV committed Jan 26, 2025
1 parent 3265f2d commit cb5aca6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/engine/renderer/tr_bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4124,10 +4124,11 @@ void R_LoadLightGrid( lump_t *l )
tmpDirected[ 2 ] = in->directed[ 2 ];
tmpDirected[ 3 ] = 255;

if ( tmpAmbient[0] < r_forceAmbient.Get() &&
tmpAmbient[1] < r_forceAmbient.Get() &&
tmpAmbient[2] < r_forceAmbient.Get() ) {
VectorSet( tmpAmbient, r_forceAmbient.Get(), r_forceAmbient.Get(), r_forceAmbient.Get() );
const byte forceAmbientNormalised = floatToUnorm8( r_forceAmbient.Get() );
if ( tmpAmbient[0] < forceAmbientNormalised &&
tmpAmbient[1] < forceAmbientNormalised &&
tmpAmbient[2] < forceAmbientNormalised ) {
VectorSet( tmpAmbient, forceAmbientNormalised, forceAmbientNormalised, forceAmbientNormalised );
}

if ( tr.legacyOverBrightClamping )
Expand Down

0 comments on commit cb5aca6

Please sign in to comment.