@@ -4134,13 +4134,6 @@ void R_LoadLightGrid( lump_t *l )
41344134 tmpDirected[ 2 ] = in->directed [ 2 ];
41354135 tmpDirected[ 3 ] = 255 ;
41364136
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 );
4142- }
4143-
41444137 if ( tr.legacyOverBrightClamping )
41454138 {
41464139 R_ColorShiftLightingBytes ( tmpAmbient );
@@ -4153,6 +4146,18 @@ void R_LoadLightGrid( lump_t *l )
41534146 directedColor[ j ] = tmpDirected[ j ] * ( 1 .0f / 255 .0f );
41544147 }
41554148
4149+ const float forceAmbient = r_forceAmbient.Get ();
4150+ if ( ambientColor[0 ] < forceAmbient &&
4151+ ambientColor[1 ] < forceAmbient &&
4152+ ambientColor[2 ] < forceAmbient &&
4153+ /* Make sure we don't change the (0, 0, 0) points because those are points in walls,
4154+ which we'll fill up by interpolating nearby points later */
4155+ ambientColor[0 ] != 0 &&
4156+ ambientColor[1 ] != 0 &&
4157+ ambientColor[2 ] != 0 ) {
4158+ VectorSet ( ambientColor, forceAmbient, forceAmbient, forceAmbient );
4159+ }
4160+
41564161 // standard spherical coordinates to cartesian coordinates conversion
41574162
41584163 // decode X as cos( lat ) * sin( long )
0 commit comments