summaryrefslogtreecommitdiffstats
path: root/src/render/lights
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-04-27 15:21:18 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-04-28 11:29:07 +0000
commit00bae43b3518eb32637749674a0a10338532b04f (patch)
tree1b1116d965e82f278c2a9e249f61729093f87522 /src/render/lights
parentb8f599b1062167ce07d944a1c6fb841b6f678d82 (diff)
Fix direction for directional and spot lights
On the shader side this is always named "direction" whatever the name of the property on the frontend object. Change-Id: I01bb8c34c687727eb018d4ce90bcadf00d9707fa Task-number: QTBUG-52710 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/lights')
-rw-r--r--src/render/lights/qdirectionallight.cpp6
-rw-r--r--src/render/lights/qspotlight.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/render/lights/qdirectionallight.cpp b/src/render/lights/qdirectionallight.cpp
index 0d7dcbcfb..d53d86aa7 100644
--- a/src/render/lights/qdirectionallight.cpp
+++ b/src/render/lights/qdirectionallight.cpp
@@ -67,7 +67,7 @@ namespace Qt3DRender {
QDirectionalLightPrivate::QDirectionalLightPrivate()
: QAbstractLightPrivate(QAbstractLight::DirectionalLight)
{
- m_shaderData->setProperty("worldDirection", QVector3D(0.0f, -1.0f, 0.0f));
+ m_shaderData->setProperty("direction", QVector3D(0.0f, -1.0f, 0.0f));
}
void QDirectionalLight::copy(const QNode *ref)
@@ -90,7 +90,7 @@ void QDirectionalLight::setWorldDirection(const QVector3D &direction)
{
Q_D(QDirectionalLight);
if (worldDirection() != direction) {
- d->m_shaderData->setProperty("worldDirection", direction);
+ d->m_shaderData->setProperty("direction", direction);
emit worldDirectionChanged(direction);
}
}
@@ -98,7 +98,7 @@ void QDirectionalLight::setWorldDirection(const QVector3D &direction)
QVector3D QDirectionalLight::worldDirection() const
{
Q_D(const QDirectionalLight);
- return d->m_shaderData->property("worldDirection").value<QVector3D>();
+ return d->m_shaderData->property("direction").value<QVector3D>();
}
} // namespace Qt3DRender
diff --git a/src/render/lights/qspotlight.cpp b/src/render/lights/qspotlight.cpp
index b70edfb18..711fb790c 100644
--- a/src/render/lights/qspotlight.cpp
+++ b/src/render/lights/qspotlight.cpp
@@ -71,7 +71,7 @@ QSpotLightPrivate::QSpotLightPrivate()
m_shaderData->setProperty("constantAttenuation", 0.0f);
m_shaderData->setProperty("linearAttenuation", 0.0f);
m_shaderData->setProperty("quadraticAttenuation", 0.0f);
- m_shaderData->setProperty("localDirection", QVector3D(0.0f, -1.0f, 0.0f));
+ m_shaderData->setProperty("direction", QVector3D(0.0f, -1.0f, 0.0f));
m_shaderData->setProperty("cutOffAngle", 45.0f);
}
@@ -174,7 +174,7 @@ void QSpotLight::setQuadraticAttenuation(float value)
QVector3D QSpotLight::localDirection() const
{
Q_D(const QSpotLight);
- return d->m_shaderData->property("localDirection").value<QVector3D>();
+ return d->m_shaderData->property("direction").value<QVector3D>();
}
@@ -197,7 +197,7 @@ void QSpotLight::setLocalDirection(const QVector3D &direction)
{
Q_D(QSpotLight);
if (localDirection() != direction) {
- d->m_shaderData->setProperty("localDirection", direction);
+ d->m_shaderData->setProperty("direction", direction);
emit localDirectionChanged(direction);
}
}