@@ -4124,13 +4124,6 @@ void R_LoadLightGrid( lump_t *l )
4124
4124
tmpDirected[ 2 ] = in->directed [ 2 ];
4125
4125
tmpDirected[ 3 ] = 255 ;
4126
4126
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 );
4132
- }
4133
-
4134
4127
if ( tr.legacyOverBrightClamping )
4135
4128
{
4136
4129
R_ColorShiftLightingBytes ( tmpAmbient );
@@ -4143,6 +4136,18 @@ void R_LoadLightGrid( lump_t *l )
4143
4136
directedColor[ j ] = tmpDirected[ j ] * ( 1 .0f / 255 .0f );
4144
4137
}
4145
4138
4139
+ const float forceAmbient = r_forceAmbient.Get ();
4140
+ if ( ambientColor[0 ] < forceAmbient &&
4141
+ ambientColor[1 ] < forceAmbient &&
4142
+ ambientColor[2 ] < forceAmbient &&
4143
+ /* Make sure we don't change the (0, 0, 0) points because those are points in walls,
4144
+ which we'll fill up by interpolating nearby points later */
4145
+ ambientColor[0 ] != 0 &&
4146
+ ambientColor[1 ] != 0 &&
4147
+ ambientColor[2 ] != 0 ) {
4148
+ VectorSet ( ambientColor, forceAmbient, forceAmbient, forceAmbient );
4149
+ }
4150
+
4146
4151
// standard spherical coordinates to cartesian coordinates conversion
4147
4152
4148
4153
// decode X as cos( lat ) * sin( long )
0 commit comments