diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index 92dd0bc80a..efc9e19111 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -866,7 +866,7 @@ void FGLRenderer::DrawPresentTexture(const GL_IRECT &box, bool applyGamma) mPresentShader->InvGamma.Set(1.0f / clamp(Gamma, 0.1f, 4.f)); mPresentShader->Contrast.Set(clamp(vid_contrast, 0.1f, 3.f)); mPresentShader->Brightness.Set(clamp(vid_brightness, -0.8f, 0.8f)); - mPresentShader->Saturation.Set(clamp(vid_saturation, -3.0f, 3.f)); + mPresentShader->Saturation.Set(clamp(vid_saturation, -15.0f, 15.f)); } mPresentShader->Scale.Set(mScreenViewport.width / (float)mBuffers->GetWidth(), mScreenViewport.height / (float)mBuffers->GetHeight()); RenderScreenQuad(); diff --git a/src/gl/stereo3d/gl_interleaved3d.cpp b/src/gl/stereo3d/gl_interleaved3d.cpp index 686802e6a3..a499f6e0e6 100644 --- a/src/gl/stereo3d/gl_interleaved3d.cpp +++ b/src/gl/stereo3d/gl_interleaved3d.cpp @@ -107,7 +107,7 @@ static void prepareInterleavedPresent(FPresentStereoShaderBase& shader) shader.InvGamma.Set(1.0f / clamp(Gamma, 0.1f, 4.f)); shader.Contrast.Set(clamp(vid_contrast, 0.1f, 3.f)); shader.Brightness.Set(clamp(vid_brightness, -0.8f, 0.8f)); - shader.Saturation.Set(clamp(vid_saturation, -3.0f, 3.0f)); + shader.Saturation.Set(clamp(vid_saturation, -15.0f, 15.0f)); } shader.Scale.Set( GLRenderer->mScreenViewport.width / (float)GLRenderer->mBuffers->GetWidth(), diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index e07f4bf7d7..bb428fa601 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2657,7 +2657,8 @@ MUSIC_DM2INT = "dm2int"; DSPLYMNU_GLOPT = "OpenGL Renderer"; DSPLYMNU_SWOPT = "Software Renderer"; DSPLYMNU_GAMMA = "Gamma correction"; -DSPLYMNU_CONTRAST ="Contrast"; +DSPLYMNU_CONTRAST = "Contrast"; +DSPLYMNU_SATURATION = "Saturation"; DSPLYMNU_HWGAMMA = "Hardware Gamma"; // OpenGL Options diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index a7e6cc4e95..e6183c15c2 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -734,14 +734,15 @@ OptionMenu "VideoOptions" protected Submenu "$DSPLYMNU_GLOPT", "OpenGLOptions" Submenu "$DSPLYMNU_SWOPT", "SWROptions" - Submenu "$GLMNU_DYNLIGHT", "GLLightOptions" + Submenu "$GLMNU_DYNLIGHT", "GLLightOptions" Submenu "$DSPLYMNU_SCOREBOARD", "ScoreboardOptions" StaticText " " - Slider "$DSPLYMNU_SCREENSIZE", "screenblocks", 3.0, 12.0, 1.0, 0 + Slider "$DSPLYMNU_SCREENSIZE", "screenblocks", 3.0, 12.0, 1.0, 0 - Slider "$DSPLYMNU_GAMMA", "Gamma", 0.75, 3.0, 0.05, 2 + Slider "$DSPLYMNU_GAMMA", "Gamma", 0.75, 3.0, 0.05, 2 Slider "$DSPLYMNU_BRIGHTNESS", "vid_brightness", -0.8,0.8, 0.05,2 - Slider "$DSPLYMNU_CONTRAST", "vid_contrast", 0.1, 3.0, 0.1 + Slider "$DSPLYMNU_CONTRAST", "vid_contrast", 0.1, 3.0, 0.1 + Slider "$DSPLYMNU_SATURATION", "vid_saturation", -3.0, 3.0, 0.25 Option "$DSPLYMNU_HWGAMMA", "vid_hwgamma", "HWGammaModes" Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff" diff --git a/wadsrc/static/shaders/glsl/present.fp b/wadsrc/static/shaders/glsl/present.fp index 3683d6bd15..9a53e0eb53 100644 --- a/wadsrc/static/shaders/glsl/present.fp +++ b/wadsrc/static/shaders/glsl/present.fp @@ -10,7 +10,11 @@ uniform float Saturation; vec4 ApplyGamma(vec4 c) { - vec3 valgray = (0.3 * c.r + 0.59 * c.g + 0.11 * c.b) * (1 - Saturation) + c.rgb * Saturation; + vec3 valgray; + if (Saturation != 1.0) // attempt to cool things a bit, this calculation makes the GPU run really hot + valgray = (0.3 * c.r + 0.59 * c.g + 0.11 * c.b) * (1 - Saturation) + c.rgb * Saturation; + else + valgray = c.rgb; vec3 val = valgray * Contrast - (Contrast - 1.0) * 0.5; val += Brightness * 0.5; val = pow(max(val, vec3(0.0)), vec3(InvGamma));