summaryrefslogtreecommitdiffstats
path: root/src/render/lights
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-07-01 08:54:23 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-07-02 08:41:18 +0000
commitd8958f750b05e403c15d641ffdedfc7469baa675 (patch)
treeeba767aefd99ee5ee3e02c6781bc8f285b78ae7d /src/render/lights
parente237c8799644e3eb6f257eb5283b0c7525cec3df (diff)
Fix QSpotLight direction handling
This is a local direction, so it needs to be marked to be transformed into a world direction on the backend side. Change-Id: I204608fb3b3b8bd30ae3687fdb53d4d4c7270219 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/lights')
-rw-r--r--src/render/lights/qspotlight.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/render/lights/qspotlight.cpp b/src/render/lights/qspotlight.cpp
index 79bb592b6..54ed8da63 100644
--- a/src/render/lights/qspotlight.cpp
+++ b/src/render/lights/qspotlight.cpp
@@ -39,6 +39,7 @@
#include "qspotlight.h"
#include "qspotlight_p.h"
+#include "shaderdata_p.h"
#include <Qt3DCore/qpropertyupdatedchange.h>
QT_BEGIN_NAMESPACE
@@ -72,6 +73,7 @@ QSpotLightPrivate::QSpotLightPrivate()
m_shaderData->setProperty("linearAttenuation", 0.0f);
m_shaderData->setProperty("quadraticAttenuation", 0.0f);
m_shaderData->setProperty("direction", QVector3D(0.0f, -1.0f, 0.0f));
+ m_shaderData->setProperty("directionTransformed", Render::ShaderData::ModelToWorldDirection);
m_shaderData->setProperty("cutOffAngle", 45.0f);
}