Fixed rendering issue when switching advanced pipeline on to off in RTT screen

This commit is contained in:
Elderme 2016-07-07 23:08:31 +02:00
parent 2da28b22b7
commit 0630145a5c
2 changed files with 7 additions and 1 deletions

View File

@ -269,6 +269,7 @@ RTT::RTT(size_t width, size_t height)
RTT::~RTT()
{
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glDeleteTextures(RTT_COUNT, RenderTargetTextures);
glDeleteTextures(1, &DepthStencilTexture);
if (CVS->isShadowEnabled())

View File

@ -55,8 +55,13 @@ void ShaderBasedRenderer::setRTTDimensions(size_t width, size_t height)
m_rtts = new RTT(width, height);
}
else
{
{
//same dimensions; we don't need to create a new RTT
//just clear FBO_COMBINED_DIFFUSE_SPECULAR
m_rtts->getFBO(FBO_COMBINED_DIFFUSE_SPECULAR).bind();
glClearColor(.5, .5, .5, .5);
glClear(GL_COLOR_BUFFER_BIT);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
return;
}
}