From 128c8d8318ab46f609f6bbf52b42208d5fbd0285 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 3 Jul 2018 23:12:47 +0200 Subject: [PATCH] - improve the bloom blur quality slightly --- .../postprocessing/hw_postprocess.cpp | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/hwrenderer/postprocessing/hw_postprocess.cpp b/src/hwrenderer/postprocessing/hw_postprocess.cpp index 9a2109a11..3df7f24d5 100644 --- a/src/hwrenderer/postprocessing/hw_postprocess.cpp +++ b/src/hwrenderer/postprocessing/hw_postprocess.cpp @@ -104,8 +104,18 @@ void PPBloom::UpdateSteps() { auto &level = levels[i]; auto &next = levels[i + 1]; + steps.Push(BlurStep(blurUniforms, level.VTexture, level.HTexture, level.Viewport, false)); - steps.Push(BlurStep(blurUniforms, level.HTexture, next.VTexture, next.Viewport, true)); + steps.Push(BlurStep(blurUniforms, level.HTexture, level.VTexture, level.Viewport, true)); + + // Linear downscale: + step.ShaderName = "BloomCombine"; + step.Uniforms.Clear(); + step.Viewport = next.Viewport; + step.SetInputTexture(0, level.VTexture, PPFilterMode::Linear); + step.SetOutputTexture(next.VTexture); + step.SetNoBlend(); + steps.Push(step); } // Blur and upscale: @@ -183,8 +193,18 @@ void PPBloom::UpdateBlurSteps() { auto &level = levels[i]; auto &next = levels[i + 1]; + steps.Push(BlurStep(blurUniforms, level.VTexture, level.HTexture, level.Viewport, false)); - steps.Push(BlurStep(blurUniforms, level.HTexture, next.VTexture, next.Viewport, true)); + steps.Push(BlurStep(blurUniforms, level.HTexture, level.VTexture, level.Viewport, true)); + + // Linear downscale: + step.ShaderName = "BloomCombine"; + step.Uniforms.Clear(); + step.Viewport = next.Viewport; + step.SetInputTexture(0, level.VTexture, PPFilterMode::Linear); + step.SetOutputTexture(next.VTexture); + step.SetNoBlend(); + steps.Push(step); } // Blur and upscale: