summaryrefslogtreecommitdiffstats
path: root/src/datavis3d/engine/bars3dcontroller.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-06-19 08:37:09 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-06-19 08:47:46 +0300
commit4cf975ad3e8f2bb6785029ffdae1b41841707692 (patch)
treeb4e40ab1203c3316b74e6653b5138a91d7f07720 /src/datavis3d/engine/bars3dcontroller.cpp
parent3f5ef027cbe49006ff34024226748ee6a5085c34 (diff)
QML2 shadows fixed again
Hack solution, may cause trouble later on. Should try to find a better way to fix this. Change-Id: I440252419a451fd26932c6d851f95259a5c60e24 Change-Id: I440252419a451fd26932c6d851f95259a5c60e24 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Diffstat (limited to 'src/datavis3d/engine/bars3dcontroller.cpp')
-rw-r--r--src/datavis3d/engine/bars3dcontroller.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/datavis3d/engine/bars3dcontroller.cpp b/src/datavis3d/engine/bars3dcontroller.cpp
index 0ca79350..07bec2ea 100644
--- a/src/datavis3d/engine/bars3dcontroller.cpp
+++ b/src/datavis3d/engine/bars3dcontroller.cpp
@@ -206,8 +206,6 @@ void Bars3dController::initializeOpenGL()
}
initBackgroundShaders(QStringLiteral(":/shaders/vertexShadow"),
QStringLiteral(":/shaders/fragmentShadowNoTex"));
- // Init the depth buffer (for shadows)
- updateDepthBuffer();
} else {
if (!m_theme->m_uniformColor) {
initShaders(QStringLiteral(":/shaders/vertex"),
@@ -882,12 +880,12 @@ void Bars3dController::drawScene(const GLuint defaultFboHandle)
#endif
}
- // Bind bar shader
- m_barShader->bind();
-
// Enable texturing
glEnable(GL_TEXTURE_2D);
+ // Bind bar shader
+ m_barShader->bind();
+
// Draw bars
if (!m_zoomActivated && m_zoomSelection)
m_zoomSelection->d_ptr->clear();
@@ -1118,12 +1116,12 @@ void Bars3dController::drawScene(const GLuint defaultFboHandle)
}
}
- // Disable textures
- glDisable(GL_TEXTURE_2D);
-
// Release background shader
m_backgroundShader->release();
+ // Disable textures
+ glDisable(GL_TEXTURE_2D);
+
// Reset culling
if (m_negativeValues) {
glEnable(GL_CULL_FACE);
@@ -1993,8 +1991,6 @@ void Bars3dController::setShadowQuality(ShadowQuality quality)
}
initBackgroundShaders(QStringLiteral(":/shaders/vertexShadow"),
QStringLiteral(":/shaders/fragmentShadowNoTex"));
- // Re-init depth buffer
- updateDepthBuffer();
} else {
// Re-init shaders
if (!m_theme->m_uniformColor) {
@@ -2006,9 +2002,9 @@ void Bars3dController::setShadowQuality(ShadowQuality quality)
}
initBackgroundShaders(QStringLiteral(":/shaders/vertex"),
QStringLiteral(":/shaders/fragment"));
- // Re-init depth buffer
- updateDepthBuffer();
}
+ // Re-init depth buffer
+ updateDepthBuffer();
#else
if (!m_theme->m_uniformColor) {
initShaders(QStringLiteral(":/shaders/vertexES2"),
@@ -2321,8 +2317,6 @@ void Bars3dController::updateDepthBuffer()
m_depthFrameBuffer,
m_shadowQuality);
}
-
- qDebug() << "updateDepthBuffer() EXIT m_depthFrameBuffer = " << m_depthFrameBuffer << ", m_depthTexture = " << m_depthTexture;
}
#endif