mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +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();
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, _isFirstFrame ? 0 : oldDiffusedFBO->texture());
|
||||
if (_isFirstFrame) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
_diffuseProgram->bind();
|
||||
QSize size = Application::getInstance()->getGLWidget()->size();
|
||||
_diffuseProgram->setUniformValue(_diffusionScaleLocation, 1.0f / size.width(), 1.0f / size.height());
|
||||
} else {
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue