From d80159b76aa8abdc12cb92c871a8923fc2c9d412 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 29 Dec 2019 14:35:24 +0100 Subject: [PATCH] - use glVertexAttrib consistently for the presentation drawcall. - fixed vid_saturation default and adjusted ranges for gamma correction CVARs. --- source/common/gamecvars.cpp | 13 ++++--------- .../common/rendering/gl/renderer/gl_postprocess.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index e6eecd6b5..ddfeed8a0 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -476,30 +476,25 @@ CUSTOM_CVAR(String, playername, "Player", CVAR_ARCHIVE | CVAR_USERINFO) CUSTOM_CVARD(Float, vid_gamma, 1.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "adjusts gamma component of gamma ramp") { if (self < 0) self = 0; - else if (self > 5) self = 5; - // todo: tell the system to update + else if (self > 4) self = 4; } CUSTOM_CVARD(Float, vid_contrast, 1.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "adjusts contrast component of gamma ramp") { if (self < 0) self = 0; else if (self > 5) self = 5; - // todo: tell the system to update } CUSTOM_CVARD(Float, vid_brightness, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "adjusts brightness component of gamma ramp") { - if (self < 0) self = 0; - else if (self > 5) self = 5; - // todo: tell the system to update + if (self < -2) self = -2; + else if (self > 2) self = 2; } - -CUSTOM_CVARD(Float, vid_saturation, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "adjusts saturation component of gamma ramp") +CUSTOM_CVARD(Float, vid_saturation, 1.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "adjusts saturation component of gamma ramp") { if (self < -3) self = -3; else if (self > 3) self = 3; - // todo: tell the system to update } CVAR(Int, gl_satformula, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); diff --git a/source/common/rendering/gl/renderer/gl_postprocess.cpp b/source/common/rendering/gl/renderer/gl_postprocess.cpp index c835aa0ac..3160dfb92 100644 --- a/source/common/rendering/gl/renderer/gl_postprocess.cpp +++ b/source/common/rendering/gl/renderer/gl_postprocess.cpp @@ -59,13 +59,13 @@ void FGLRenderer::RenderScreenQuad() #else glBegin(GL_TRIANGLE_STRIP); glVertexAttrib2f(1, 0, 0); - glVertex2f(-1, -1); + glVertexAttrib2f(0, -1, -1); glVertexAttrib2f(1, 0, 1); - glVertex2f(-1, 1); + glVertexAttrib2f(0, -1, 1); glVertexAttrib2f(1, 1, 0); - glVertex2f(1, -1); + glVertexAttrib2f(0, 1, -1); glVertexAttrib2f(1, 1, 1); - glVertex2f(1,1); + glVertexAttrib2f(0, 1,1); glEnd(); #endif }