Skip to content

Commit b698187

Browse files
committed
Address some feedback make it all work correctly
1 parent 7c11475 commit b698187

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

code/def_files/data/effects/lighting.sdr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const float SPEC_FACTOR_NO_SPEC_MAP = 0.6;
1212
const float ENV_ALPHA_FACTOR = 0.3;
1313
const float GLOW_MAP_INTENSITY = 1.5;
1414
const float AMBIENT_LIGHT_BOOST = 1.0;
15+
const float GLOW_MAP_SRGB_MULTIPLIER = 3.0;
1516

1617
vec3 FresnelSchlick(vec3 specColor, vec3 light, vec3 halfVec)
1718
{

code/def_files/data/effects/main-f.sdr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,17 @@ void main()
293293
#ifdef FLAG_TEAMCOLOR
294294
vec4 teamMask = vec4(0.0, 0.0, 0.0, 0.0);
295295
teamMask = texture(sMiscmap, vec3(texCoord, float(sMiscmapIndex)));
296-
vec3 team_color = (base_color * teamMask.x) + (stripe_color * teamMask.y);
297-
vec3 team_color_glow = (base_color * teamMask.b) + (stripe_color * teamMask.a);
296+
vec3 team_color = ((base_color - vec3(0.5)) * teamMask.x) + ((stripe_color - vec3(0.5)) * teamMask.y);
297+
vec3 team_color_glow = ((base_color - vec3(0.5)) * teamMask.b) + ((stripe_color - vec3(0.5)) * teamMask.a);
298298
#ifdef FLAG_HDR
299299
team_color = pow(team_color, vec3(SRGB_GAMMA));
300-
team_color_glow = pow(team_color_glow, vec3(SRGB_GAMMA)) * 3.0f;
300+
team_color_glow = pow(team_color_glow, vec3(SRGB_GAMMA)) * GLOW_MAP_SRGB_MULTIPLIER;
301301
#endif
302302

303303
baseColor.rgb += team_color;
304304
baseColor.rgb = max(baseColor.rgb, vec3(0.0));
305305
specColor.rgb += team_color;
306-
specColor.rgb = max(specColor.rgb, vec3(0.03f));
306+
specColor.rgb = max(specColor.rgb, vec3(0.03));
307307
#endif
308308
#endif
309309
// Lights aren't applied when we are rendering to the G-buffers since that gets handled later
@@ -350,7 +350,7 @@ void main()
350350
vec3 glowColor = texture(sGlowmap, vec3(texCoord, float(sGlowmapIndex))).rgb;
351351
if(overrideGlow) glowColor = glowClr;
352352
#ifdef FLAG_HDR
353-
glowColor = pow(glowColor, vec3(SRGB_GAMMA)) * 3.0f;
353+
glowColor = pow(glowColor, vec3(SRGB_GAMMA)) * GLOW_MAP_SRGB_MULTIPLIER;
354354
#endif
355355
#ifdef FLAG_MISC_MAP
356356
#ifdef FLAG_TEAMCOLOR

0 commit comments

Comments
 (0)