diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/defaults/qpervertexcolormaterial.cpp | 13 | ||||
-rw-r--r-- | src/render/defaults/qpervertexcolormaterial_p.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/render/defaults/qpervertexcolormaterial.cpp b/src/render/defaults/qpervertexcolormaterial.cpp index 36468e90e..8cbc42736 100644 --- a/src/render/defaults/qpervertexcolormaterial.cpp +++ b/src/render/defaults/qpervertexcolormaterial.cpp @@ -36,6 +36,7 @@ #include "qpervertexcolormaterial.h" #include "qpervertexcolormaterial_p.h" +#include <Qt3DRender/qannotation.h> #include <Qt3DRender/qmaterial.h> #include <Qt3DRender/qeffect.h> #include <Qt3DRender/qtechnique.h> @@ -66,6 +67,7 @@ QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate() , m_vertexES2RenderPass(new QRenderPass()) , m_vertexGL3Shader(new QShaderProgram()) , m_vertexGL2ES2Shader(new QShaderProgram()) + , m_annotation(new QAnnotation) { } @@ -131,6 +133,15 @@ void QPerVertexColorMaterialPrivate::init() m_vertexES2Technique->graphicsApiFilter()->setMinorVersion(0); m_vertexES2Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::NoProfile); + Q_Q(QPerVertexColorMaterial); + m_annotation->setParent(q); + m_annotation->setName(QStringLiteral("renderingStyle")); + m_annotation->setValue("forward"); + + m_vertexGL3Technique->addAnnotation(m_annotation); + m_vertexGL2Technique->addAnnotation(m_annotation); + m_vertexES2Technique->addAnnotation(m_annotation); + m_vertexGL3RenderPass->setShaderProgram(m_vertexGL3Shader); m_vertexGL2RenderPass->setShaderProgram(m_vertexGL2ES2Shader); m_vertexES2RenderPass->setShaderProgram(m_vertexGL2ES2Shader); @@ -143,7 +154,7 @@ void QPerVertexColorMaterialPrivate::init() m_vertexEffect->addTechnique(m_vertexGL2Technique); m_vertexEffect->addTechnique(m_vertexES2Technique); - q_func()->setEffect(m_vertexEffect); + q->setEffect(m_vertexEffect); } } // namespace Qt3DRender diff --git a/src/render/defaults/qpervertexcolormaterial_p.h b/src/render/defaults/qpervertexcolormaterial_p.h index 9e8298667..26c5524e7 100644 --- a/src/render/defaults/qpervertexcolormaterial_p.h +++ b/src/render/defaults/qpervertexcolormaterial_p.h @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +class QAnnotation; class QEffect; class QTechnique; class QParameter; @@ -79,6 +80,7 @@ public: QRenderPass *m_vertexES2RenderPass; QShaderProgram *m_vertexGL3Shader; QShaderProgram *m_vertexGL2ES2Shader; + QAnnotation *m_annotation; Q_DECLARE_PUBLIC(QPerVertexColorMaterial) }; |