From 8aebfdb3abac02639ba6936e3a76912089ba24ad Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 Aug 2016 11:29:28 +0200 Subject: [PATCH 1/3] - fixed: gl_bloom_amount may never be 0. --- src/gl/renderer/gl_postprocess.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index 5ccacf305..d5b4005b6 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -76,7 +76,11 @@ // //========================================================================== CVAR(Bool, gl_bloom, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); -CVAR(Float, gl_bloom_amount, 1.4f, 0) +CUSTOM_CVAR(Float, gl_bloom_amount, 1.4f, 0) +{ + if (self < 0.1f) self = 0.1f; +} + CVAR(Float, gl_exposure, 0.0f, 0) CUSTOM_CVAR(Int, gl_tonemap, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) From f980a1f42ba9d7e8bea557e4a834dbe0944646c1 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 1 Aug 2016 15:12:13 +0200 Subject: [PATCH 2/3] Fix wrong UV calculations when resizing or maximizing window --- src/gl/renderer/gl_postprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index d5b4005b6..1e400f597 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -355,7 +355,7 @@ void FGLRenderer::CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma) mPresentShader->Brightness.Set(clamp(vid_brightness, -0.8f, 0.8f)); } mBuffers->BindHudTexture(0); - mVBO->RenderScreenQuad(width / (float)mBuffers->GetWidth(), height / (float)mBuffers->GetHeight()); + mVBO->RenderScreenQuad(mScreenViewport.width / (float)mBuffers->GetWidth(), mScreenViewport.height / (float)mBuffers->GetHeight()); if (blendEnabled) glEnable(GL_BLEND); From 5a67ae6021f13f9d2e56ed32d326bd0f7909b26f Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 2 Aug 2016 00:27:01 +0200 Subject: [PATCH 3/3] Fix missing VBO bind calls --- src/gl/renderer/gl_postprocess.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index d5b4005b6..f029d17c4 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -149,6 +149,7 @@ void FGLRenderer::BloomScene() mBloomExtractShader->Bind(); mBloomExtractShader->SceneTexture.Set(0); mBloomExtractShader->Exposure.Set(mCameraExposure); + mVBO->BindVBO(); mVBO->RenderScreenQuad(); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -246,6 +247,7 @@ void FGLRenderer::TonemapScene() mTonemapShader->Bind(); mTonemapShader->SceneTexture.Set(0); mTonemapShader->Exposure.Set(mCameraExposure); + mVBO->BindVBO(); mVBO->RenderScreenQuad(); if (blendEnabled) @@ -355,6 +357,7 @@ void FGLRenderer::CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma) mPresentShader->Brightness.Set(clamp(vid_brightness, -0.8f, 0.8f)); } mBuffers->BindHudTexture(0); + mVBO->BindVBO(); mVBO->RenderScreenQuad(width / (float)mBuffers->GetWidth(), height / (float)mBuffers->GetHeight()); if (blendEnabled)