From 877bf938bd416d703e775dc7752c183c3336c660 Mon Sep 17 00:00:00 2001 From: vlj Date: Sun, 8 Jun 2014 02:50:02 +0200 Subject: [PATCH] Fix different color with/without mlaa. --- src/graphics/post_processing.cpp | 11 ++++++----- src/graphics/render.cpp | 13 +------------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 45ff6fb26..108e07b78 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -859,16 +859,17 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode) PROFILER_POP_CPU_MARKER(); } + glEnable(GL_FRAMEBUFFER_SRGB); + irr_driver->getFBO(FBO_MLAA_COLORS).Bind(); + renderPassThrough(in_fbo->getRTT()[0]); + glDisable(GL_FRAMEBUFFER_SRGB); + out_fbo = &irr_driver->getFBO(FBO_MLAA_COLORS); + if (UserConfigParams::m_mlaa) // MLAA. Must be the last pp filter. { PROFILER_PUSH_CPU_MARKER("- MLAA", 0xFF, 0x00, 0x00); ScopedGPUTimer Timer(irr_driver->getGPUTimer(Q_MLAA)); - glEnable(GL_FRAMEBUFFER_SRGB); - irr_driver->getFBO(FBO_MLAA_COLORS).Bind(); - renderPassThrough(in_fbo->getRTT()[0]); - glDisable(GL_FRAMEBUFFER_SRGB); applyMLAA(); - out_fbo = &irr_driver->getFBO(FBO_MLAA_COLORS); PROFILER_POP_CPU_MARKER(); } diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index fe021a16d..b7647a38c 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -198,18 +198,7 @@ void IrrDriver::renderGLSL(float dt) m_post_processing->renderPassThrough(m_rtts->getRSM().getRTT()[0]); } else - { - if (UserConfigParams::m_mlaa) // MLAA_COLORS already in srgb space - fbo->BlitToDefault(viewport.UpperLeftCorner.X, viewport.UpperLeftCorner.Y, viewport.LowerRightCorner.X, viewport.LowerRightCorner.Y); - else - { - glEnable(GL_FRAMEBUFFER_SRGB); - glBindFramebuffer(GL_FRAMEBUFFER, 0); - m_post_processing->renderPassThrough(fbo->getRTT()[0]); - glDisable(GL_FRAMEBUFFER_SRGB); - } - } - + fbo->BlitToDefault(viewport.UpperLeftCorner.X, viewport.UpperLeftCorner.Y, viewport.LowerRightCorner.X, viewport.LowerRightCorner.Y); } else glDisable(GL_FRAMEBUFFER_SRGB);