From 8eb825e25a25a3bd064476847414a690b3aa5d53 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 30 Jun 2018 16:44:09 +0200 Subject: [PATCH] - fix some postprocess bugs --- src/gl/renderer/gl_renderbuffers.cpp | 2 +- src/hwrenderer/postprocessing/hw_postprocess.cpp | 1 + wadsrc/static/shaders/glsl/tonemap.fp | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gl/renderer/gl_renderbuffers.cpp b/src/gl/renderer/gl_renderbuffers.cpp index 425393a22..d8c1831d6 100644 --- a/src/gl/renderer/gl_renderbuffers.cpp +++ b/src/gl/renderer/gl_renderbuffers.cpp @@ -902,7 +902,7 @@ void FGLRenderBuffers::RenderEffect(const FString &name) GLTextureFBs[step.Output.Texture].Bind(); break; - case PPTextureType::SceneNormal: + case PPTextureType::SceneColor: BindSceneFB(false); break; } diff --git a/src/hwrenderer/postprocessing/hw_postprocess.cpp b/src/hwrenderer/postprocessing/hw_postprocess.cpp index 070251b2a..228c9d3fb 100644 --- a/src/hwrenderer/postprocessing/hw_postprocess.cpp +++ b/src/hwrenderer/postprocessing/hw_postprocess.cpp @@ -15,6 +15,7 @@ Postprocess::Postprocess() Managers.Push(new PPCameraExposure()); Managers.Push(new PPColormap()); Managers.Push(new PPTonemap()); + Managers.Push(new PPAmbientOcclusion()); } Postprocess::~Postprocess() diff --git a/wadsrc/static/shaders/glsl/tonemap.fp b/wadsrc/static/shaders/glsl/tonemap.fp index 29d52cd45..9e3b35a0f 100644 --- a/wadsrc/static/shaders/glsl/tonemap.fp +++ b/wadsrc/static/shaders/glsl/tonemap.fp @@ -68,12 +68,11 @@ layout(binding=1) uniform sampler2D PaletteLUT; vec3 Tonemap(vec3 color) { - /*ivec3 c = ivec3(clamp(color.rgb, vec3(0.0), vec3(1.0)) * 63.0 + 0.5); + ivec3 c = ivec3(clamp(color.rgb, vec3(0.0), vec3(1.0)) * 63.0 + 0.5); int index = (c.r * 64 + c.g) * 64 + c.b; int tx = index % 512; int ty = index / 512; - return texelFetch(PaletteLUT, ivec2(tx, ty), 0).rgb;*/ - return texture(PaletteLUT, TexCoord).rgb; + return texelFetch(PaletteLUT, ivec2(tx, ty), 0).rgb; } #else