summaryrefslogtreecommitdiff
path: root/src/render/materialsystem/shaderdata_p.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-23 09:33:53 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-23 09:33:53 +0200
commitec2c6c0f13004bc1bba92f14443228778da287a0 (patch)
tree5c4e2621091ad7bbd31e6ffb6a277c1aaee39b55 /src/render/materialsystem/shaderdata_p.h
parent5476bc6b4b6a12c921da502c24c4e078b04dd3b3 (diff)
parent0e3d54f8d7f9be26687afebcc9f456e4cefc2357 (diff)
downloadqt3d-wip/qtquickintergration.tar.gz
Merge remote-tracking branch 'origin/5.8' into devwip/qtquickintergrationwip/particles
Change-Id: I4e1c528eb8e1c81aead51a5664635ca2becad397
Diffstat (limited to 'src/render/materialsystem/shaderdata_p.h')
-rw-r--r--src/render/materialsystem/shaderdata_p.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/render/materialsystem/shaderdata_p.h b/src/render/materialsystem/shaderdata_p.h
index 46dd26faf..6ce0c734c 100644
--- a/src/render/materialsystem/shaderdata_p.h
+++ b/src/render/materialsystem/shaderdata_p.h
@@ -71,6 +71,7 @@ class Q_AUTOTEST_EXPORT ShaderData : public BackendNode
{
public:
enum TransformType {
+ NoTransform = -1,
ModelToEye = 0,
ModelToWorld,
ModelToWorldDirection
@@ -79,15 +80,16 @@ public:
ShaderData();
~ShaderData();
- QHash<QString, QVariant> properties() const { return m_properties; }
- QHash<QString, QVariant> updatedProperties() const { return m_updatedProperties; }
+ QHash<QString, QVariant> properties() const { return m_originalProperties; }
// Called by FramePreparationJob
- bool updateWorldTransform(const QMatrix4x4 &worldMatrix);
+ void updateWorldTransform(const QMatrix4x4 &worldMatrix);
// Call by RenderViewJob
void markDirty();
- bool updateViewTransform(const QMatrix4x4 &viewMatrix);
+
+ TransformType propertyTransformType(const QString &name) const;
+ QVariant getTransformedProperty(const QString &name, const QMatrix4x4 &viewMatrix);
// Called by FrameCleanupJob
static void cleanup(NodeManagers *managers);
@@ -98,17 +100,18 @@ protected:
void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_OVERRIDE;
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE;
+ PropertyReaderInterfacePtr m_propertyReader;
+
// 1 to 1 match with frontend properties, modified only by sceneChangeEvent
QHash<QString, QVariant> m_originalProperties;
- // 1 to 1 match with frontend properties apart from Transformed
- // properties which contain the matrices product
- QHash<QString, QVariant> m_properties;
- // only updated properties, Transformed properties have the same
- // value as in m_properties
- QHash<QString, QVariant> m_updatedProperties;
- PropertyReaderInterfacePtr m_propertyReader;
+
+ // Contains properties thar are of type ShaderData
QHash<QString, QVariant> m_nestedShaderDataProperties;
+
+ // Contains property that are defined like: postionTransformed: ModelToEye
QHash<QString, TransformType> m_transformedProperties;
+
+
QMutex m_mutex;
static QVector<Qt3DCore::QNodeId> m_updatedShaderData;
QMatrix4x4 m_worldMatrix;