diff options
author | Antti Määttä <antti.maatta@qt.io> | 2019-11-27 09:55:25 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2019-11-27 14:21:20 +0200 |
commit | 239318f4c87a206f72aa7f25abf28480699524ac (patch) | |
tree | aeb1c199e3a90740a79b6b86fff3b637b28b1be5 | |
parent | 1b6be7062293447a1038cff5e3d020b6a0c84c0d (diff) |
Use correct blending mode for subpresentations
Change the source blending mode to One. The texture contains premultiplied
colors so the result is too dark if we again multiply with the source alpha.
Task-number: QT3DS-4008
Change-Id: Ic92fc4abee289913be5b538126c4ee80ebb4d5e8
Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/Authoring/Qt3DStudio/Render/StudioSubPresentationRenderer.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Authoring/Qt3DStudio/Render/StudioSubPresentationRenderer.cpp b/src/Authoring/Qt3DStudio/Render/StudioSubPresentationRenderer.cpp index b04233cd..e76f9ba4 100644 --- a/src/Authoring/Qt3DStudio/Render/StudioSubPresentationRenderer.cpp +++ b/src/Authoring/Qt3DStudio/Render/StudioSubPresentationRenderer.cpp @@ -200,12 +200,9 @@ SOffscreenRendererEnvironment StudioSubpresentationRenderer::GetDesiredEnvironment(QT3DSVec2 inPresentationScaleFactor) { // If we aren't using a clear color, then we are expected to blend with the background - if (!m_thread->m_initialized) { + if (!m_thread->m_initialized) initialize(); - } - bool hasTransparency = true; - NVRenderTextureFormats::Enum format = - hasTransparency ? NVRenderTextureFormats::RGBA8 : NVRenderTextureFormats::RGB8; + NVRenderTextureFormats::Enum format = NVRenderTextureFormats::RGBA8; return SOffscreenRendererEnvironment( QT3DSU32(m_thread->m_size.width() * inPresentationScaleFactor.x), QT3DSU32(m_thread->m_size.height() * inPresentationScaleFactor.y), @@ -257,7 +254,7 @@ void StudioSubpresentationRenderer::Render(const SOffscreenRendererEnvironment & else func->glEnable(GL_BLEND); func->glBlendEquation(GL_FUNC_ADD); - func->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + func->glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); if (!m_program) initializeFboCopy(); |