From db4310ca6bb9cd2548686e116f2d3496921a24e8 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 11 Apr 2019 03:34:34 +0200 Subject: [PATCH] - prevent excessively bright pixels as this is actually visible on a HDR monitor --- wadsrc/static/shaders/glsl/present.fp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wadsrc/static/shaders/glsl/present.fp b/wadsrc/static/shaders/glsl/present.fp index 2800c13de..6a484f7a3 100644 --- a/wadsrc/static/shaders/glsl/present.fp +++ b/wadsrc/static/shaders/glsl/present.fp @@ -7,6 +7,8 @@ layout(binding=1) uniform sampler2D DitherTexture; vec4 ApplyGamma(vec4 c) { + c.rgb = min(c.rgb, vec3(2.0)); // for HDR mode - prevents stacked translucent sprites (such as plasma) producing way too bright light + vec3 valgray; if (GrayFormula == 0) valgray = vec3(c.r + c.g + c.b) * (1 - Saturation) / 3 + c.rgb * Saturation;