Clear SSAO fbo at least once.

On intel driver (windows) texture swizzling seem not to work everytime
so use an untouched rtt instead of swizzling SSAO rtt if ssao is
disabled.
This commit is contained in:
Vincent Lejeune 2014-04-05 21:21:01 +02:00
parent 150ee87471
commit ada1d2617c
2 changed files with 4 additions and 5 deletions

View File

@ -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);
}

View File

@ -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);