mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
Get rid of initial glow.
This commit is contained in:
parent
c36e04c435
commit
2381b2bbaf
1 changed files with 12 additions and 7 deletions
|
@ -167,16 +167,21 @@ QOpenGLFramebufferObject* GlowEffect::render(bool toTexture) {
|
||||||
}
|
}
|
||||||
newDiffusedFBO->bind();
|
newDiffusedFBO->bind();
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE1);
|
if (_isFirstFrame) {
|
||||||
glBindTexture(GL_TEXTURE_2D, _isFirstFrame ? 0 : oldDiffusedFBO->texture());
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
_diffuseProgram->bind();
|
} else {
|
||||||
QSize size = Application::getInstance()->getGLWidget()->size();
|
glActiveTexture(GL_TEXTURE1);
|
||||||
_diffuseProgram->setUniformValue(_diffusionScaleLocation, 1.0f / size.width(), 1.0f / size.height());
|
glBindTexture(GL_TEXTURE_2D, oldDiffusedFBO->texture());
|
||||||
|
|
||||||
|
_diffuseProgram->bind();
|
||||||
|
QSize size = Application::getInstance()->getGLWidget()->size();
|
||||||
|
_diffuseProgram->setUniformValue(_diffusionScaleLocation, 1.0f / size.width(), 1.0f / size.height());
|
||||||
|
|
||||||
renderFullscreenQuad();
|
renderFullscreenQuad();
|
||||||
|
|
||||||
_diffuseProgram->release();
|
_diffuseProgram->release();
|
||||||
|
}
|
||||||
|
|
||||||
newDiffusedFBO->release();
|
newDiffusedFBO->release();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue