Skip to content

Commit eeb0ce4

Browse files
committed
always linearize lightgrid before interpolation, this is correct
1 parent 7b0a4e4 commit eeb0ce4

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

src/engine/renderer/glsl_source/computeLight_fp.glsl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,8 @@ vec4 EnvironmentalSpecularFactor( vec3 viewDir, vec3 normal )
6767
ambientColor = ambientScale * texel.rgb;
6868
lightColor = directedScale * texel.rgb;
6969

70-
#if defined(r_cheapSRGB)
71-
/* The light grid conversion from sRGB is done in C++ code
72-
when loading it, meaning it's done before interpolation. */
73-
#else
74-
convertFromSRGB(lightColor, linearizeLightMap);
75-
convertFromSRGB(ambientColor, linearizeLightMap);
76-
#endif
70+
/* The light grid conversion from sRGB is done in C++ code
71+
when loading it, so it's done before interpolation. */
7772

7873
ambientColor *= lightFactor;
7974
lightColor *= lightFactor;

src/engine/renderer/tr_bsp.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4157,16 +4157,8 @@ void R_LoadLightGrid( lump_t *l )
41574157

41584158
if ( tr.worldLinearizeLightMap )
41594159
{
4160-
if ( r_cheapSRGB.Get() )
4161-
{
4162-
ambientColor[ j ] = convertFromSRGB( ambientColor[ j ] );
4163-
directedColor[ j ] = convertFromSRGB( directedColor[ j ] );
4164-
}
4165-
else
4166-
{
4167-
/* When not cheap, the light grid conversion from sRGB is done
4168-
in GLSL code after interpolation. */
4169-
}
4160+
ambientColor[ j ] = convertFromSRGB( ambientColor[ j ] );
4161+
directedColor[ j ] = convertFromSRGB( directedColor[ j ] );
41704162
}
41714163
}
41724164

0 commit comments

Comments
 (0)