summaryrefslogtreecommitdiffstats
path: root/src/render/materialsystem/shaderdata_p.h
diff options
context:
space:
mode:
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;