From dfdbe9c36f229e16c863ebf53332c6333f6068f9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 20 Nov 2014 16:07:18 +0200 Subject: Fix incorrect shader initialization for static optimized es2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8fdacfde272ace4c25c74c316de514cd4275da74 Reviewed-by: Tomi Korpipää Reviewed-by: Mika Salmela --- src/datavisualization/engine/abstract3drenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp index c44eee7f..a880550b 100644 --- a/src/datavisualization/engine/abstract3drenderer.cpp +++ b/src/datavisualization/engine/abstract3drenderer.cpp @@ -464,8 +464,8 @@ void Abstract3DRenderer::reInitShaders() QStringLiteral(":/shaders/fragmentES2"), QStringLiteral(":/shaders/vertex"), QStringLiteral(":/shaders/fragmentColorOnYES2")); - initBackgroundShaders(QStringLiteral(":/shaders/vertexNoMatrices"), - QStringLiteral(":/shaders/fragmentES2")); + initShaders(QStringLiteral(":/shaders/vertexNoMatrices"), + QStringLiteral(":/shaders/fragmentES2")); } else { initGradientShaders(QStringLiteral(":/shaders/vertex"), QStringLiteral(":/shaders/fragmentColorOnYES2")); -- cgit v1.2.3 From 2f7c12bfee0315baa46b69fdb5185c522ec7cb2b Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 21 Nov 2014 12:42:18 +0200 Subject: Make customitems example actually show some custom items. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I056b71fc913e5fd68b895d6bf4b5676cbe7c6db0 Reviewed-by: Tomi Korpipää --- examples/datavisualization/customitems/customitemgraph.cpp | 3 +++ examples/datavisualization/customitems/main.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/examples/datavisualization/customitems/customitemgraph.cpp b/examples/datavisualization/customitems/customitemgraph.cpp index 182bf7d7..404aa943 100644 --- a/examples/datavisualization/customitems/customitemgraph.cpp +++ b/examples/datavisualization/customitems/customitemgraph.cpp @@ -109,6 +109,9 @@ CustomItemGraph::CustomItemGraph(Q3DSurface *surface, QLabel *label) titleLabel->setFacingCamera(true); titleLabel->setBackgroundColor(QColor(0x66cdaa)); m_graph->addCustomItem(titleLabel); + + toggleItemOne(true); + toggleItemTwo(true); } CustomItemGraph::~CustomItemGraph() diff --git a/examples/datavisualization/customitems/main.cpp b/examples/datavisualization/customitems/main.cpp index d89d9ad9..d7c301e7 100644 --- a/examples/datavisualization/customitems/main.cpp +++ b/examples/datavisualization/customitems/main.cpp @@ -53,10 +53,12 @@ int main(int argc, char **argv) font.setBold(false); QCheckBox *checkboxOne = new QCheckBox("Oil Rig 1"); + checkboxOne->setChecked(true); checkboxOne->setFont(font); vLayoutLeft->addWidget(checkboxOne); QCheckBox *checkboxTwo = new QCheckBox("Oil Rig 2"); + checkboxTwo->setChecked(true); checkboxTwo->setFont(font); vLayoutLeft->addWidget(checkboxTwo); -- cgit v1.2.3 From 7b2cd00ce86579a1bb32a7a6e529331405a940d8 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 21 Nov 2014 12:43:25 +0200 Subject: Fix invalid enum error in OpenGL ES2 builds. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib4587a608a7b79d863d51e1a9ecd150996245fa7 Reviewed-by: Tomi Korpipää --- src/datavisualizationqml2/glstatestore.cpp | 12 +++--------- src/datavisualizationqml2/glstatestore_p.h | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/datavisualizationqml2/glstatestore.cpp b/src/datavisualizationqml2/glstatestore.cpp index 4b146d7a..b1b2b1c8 100644 --- a/src/datavisualizationqml2/glstatestore.cpp +++ b/src/datavisualizationqml2/glstatestore.cpp @@ -80,8 +80,6 @@ void GLStateStore::storeGLState() glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &m_drawFramebuffer); glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &m_readFramebuffer); glGetIntegerv(GL_RENDERBUFFER_BINDING, &m_renderbuffer); -#else - glGetIntegerv(GL_RENDERBUFFER, &m_renderbuffer); #endif glGetFloatv(GL_COLOR_CLEAR_VALUE, m_clearColor); m_isBlendingEnabled = glIsEnabled(GL_BLEND); @@ -138,8 +136,8 @@ void GLStateStore::printCurrentState(bool in) #if !defined(QT_OPENGL_ES_2) GLint drawFramebuffer; GLint readFramebuffer; -#endif GLint renderbuffer; +#endif GLfloat clearColor[4]; GLfloat clearDepth; GLboolean isBlendingEnabled = glIsEnabled(GL_BLEND); @@ -178,8 +176,6 @@ void GLStateStore::printCurrentState(bool in) glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFramebuffer); glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &readFramebuffer); glGetIntegerv(GL_RENDERBUFFER_BINDING, &renderbuffer); -#else - glGetIntegerv(GL_RENDERBUFFER, &renderbuffer); #endif glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor); glGetFloatv(GL_DEPTH_CLEAR_VALUE, &clearDepth); @@ -223,8 +219,8 @@ void GLStateStore::printCurrentState(bool in) msg << "---" << endl; msg << " GL_DRAW_FRAMEBUFFER_BINDING "<< drawFramebuffer << endl; msg << " GL_READ_FRAMEBUFFER_BINDING "<< readFramebuffer << endl; -#endif msg << " GL_RENDERBUFFER_BINDING " << renderbuffer << endl; +#endif msg << " GL_SCISSOR_TEST " << bool(isScissorTestEnabled) << endl; msg << " GL_SCISSOR_BOX " << m_scissorBox[0] << m_scissorBox[1] << m_scissorBox[2] << m_scissorBox[3] << endl; @@ -275,8 +271,6 @@ void GLStateStore::restoreGLState() glBindFramebuffer(GL_READ_FRAMEBUFFER, m_readFramebuffer); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_drawFramebuffer); glBindRenderbuffer(GL_RENDERBUFFER_BINDING, m_renderbuffer); -#else - glBindRenderbuffer(GL_RENDERBUFFER, m_renderbuffer); #endif if (m_isScissorTestEnabled) @@ -351,8 +345,8 @@ void GLStateStore::initGLDefaultState() #if !defined(QT_OPENGL_ES_2) m_drawFramebuffer = 0; m_readFramebuffer = 0; -#endif m_renderbuffer = 0; +#endif m_clearColor[0] = m_clearColor[1] = m_clearColor[2] = m_clearColor[3] = 1.0f; m_clearDepth = 1.0f; m_isBlendingEnabled = GL_FALSE; diff --git a/src/datavisualizationqml2/glstatestore_p.h b/src/datavisualizationqml2/glstatestore_p.h index 36484f28..db3f555a 100644 --- a/src/datavisualizationqml2/glstatestore_p.h +++ b/src/datavisualizationqml2/glstatestore_p.h @@ -55,8 +55,8 @@ public: #if !defined(QT_OPENGL_ES_2) GLint m_drawFramebuffer; GLint m_readFramebuffer; -#endif GLint m_renderbuffer; +#endif GLfloat m_clearColor[4]; GLfloat m_clearDepth; GLboolean m_isBlendingEnabled; -- cgit v1.2.3 From 4830e55e98e7e77586b0abc68f208a0176f14103 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 21 Nov 2014 12:44:18 +0200 Subject: Fix flickering in android on some examples when zooming. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3c9de6801430dc74c97fb6563ded6114befc6968 Reviewed-by: Tomi Korpipää --- src/datavisualization/engine/abstract3drenderer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp index a880550b..1f459930 100644 --- a/src/datavisualization/engine/abstract3drenderer.cpp +++ b/src/datavisualization/engine/abstract3drenderer.cpp @@ -1768,6 +1768,11 @@ void Abstract3DRenderer::queriedGraphPosition(const QMatrix4x4 &projectionViewMa // Restore state glEnable(GL_DITHER); glCullFace(GL_BACK); + + // Note: Zeroing the frame buffer before resetting it is a workaround for flickering that occurs + // during zoom in some environments. + glBindFramebuffer(GL_FRAMEBUFFER, 0); + glBindFramebuffer(GL_FRAMEBUFFER, defaultFboHandle); glViewport(m_primarySubViewport.x(), m_primarySubViewport.y(), -- cgit v1.2.3 From cf47756e17fe0a0ecffbe167cd66272668e2f3f2 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 21 Nov 2014 13:26:00 +0200 Subject: Minor tweaks to texturesurface example. Change the color of untextured surface so it isn't included in the gradient. Also make it clear the gradient is for highlight only. Change-Id: I822c59b905559da10a987e4a7d616d01dccdedba Reviewed-by: Mika Salmela --- examples/datavisualization/texturesurface/main.cpp | 2 +- examples/datavisualization/texturesurface/topographicseries.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/datavisualization/texturesurface/main.cpp b/examples/datavisualization/texturesurface/main.cpp index eda6a54a..5d61b5d7 100644 --- a/examples/datavisualization/texturesurface/main.cpp +++ b/examples/datavisualization/texturesurface/main.cpp @@ -80,7 +80,7 @@ int main(int argc, char **argv) QLabel *label = new QLabel(widget); label->setPixmap(pm); - QGroupBox *heightMapGroupBox = new QGroupBox(QStringLiteral("Height color map")); + QGroupBox *heightMapGroupBox = new QGroupBox(QStringLiteral("Highlight color map")); QVBoxLayout *colorMapVBox = new QVBoxLayout; colorMapVBox->addWidget(label); heightMapGroupBox->setLayout(colorMapVBox); diff --git a/examples/datavisualization/texturesurface/topographicseries.cpp b/examples/datavisualization/texturesurface/topographicseries.cpp index 2935244d..faeafbe9 100644 --- a/examples/datavisualization/texturesurface/topographicseries.cpp +++ b/examples/datavisualization/texturesurface/topographicseries.cpp @@ -29,6 +29,7 @@ TopographicSeries::TopographicSeries() { setDrawMode(QSurface3DSeries::DrawSurface); setFlatShadingEnabled(true); + setBaseColor(Qt::white); } TopographicSeries::~TopographicSeries() -- cgit v1.2.3