diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index c43f9975a..d444bb5f3 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -441,11 +441,6 @@ void IrrDriver::renderSolidSecondPass() setTexture(0, m_rtts->getRenderTarget(RTT_TMP1), GL_NEAREST, GL_NEAREST); setTexture(1, m_rtts->getRenderTarget(RTT_TMP2), GL_NEAREST, GL_NEAREST); setTexture(2, m_rtts->getRenderTarget(RTT_SSAO), GL_NEAREST, GL_NEAREST); - if (!UserConfigParams::m_ssao) - { - GLint swizzleMask[] = { GL_ONE, GL_ONE, GL_ONE, GL_ONE }; - glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); - } m_scene_manager->drawAll(m_renderpass); } diff --git a/src/graphics/rtts.cpp b/src/graphics/rtts.cpp index 033631b58..4532035f2 100644 --- a/src/graphics/rtts.cpp +++ b/src/graphics/rtts.cpp @@ -100,6 +100,10 @@ RTT::RTT() RenderTargetTextures[RTT_EIGHTH2] = generateRTT(eighth, GL_RGBA16F, GL_BGRA, GL_FLOAT); FrameBuffers[FBO_SSAO] = generateFBO(RenderTargetTextures[RTT_SSAO]); + // Clear this FBO to 1s so that if no SSAO is computed we can still use it. + glClearColor(1., 1., 1., 1.); + glClear(GL_COLOR_BUFFER_BIT); + FrameBuffers[FBO_NORMAL_AND_DEPTHS] = generateFBO(RenderTargetTextures[RTT_NORMAL_AND_DEPTH], DepthStencilTexture); FrameBuffers[FBO_COLORS] = generateFBO(RenderTargetTextures[RTT_COLOR], DepthStencilTexture); FrameBuffers[FBO_MLAA_COLORS] = generateFBO(RenderTargetTextures[RTT_MLAA_COLORS], DepthStencilTexture);