diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-12-04 15:56:24 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-12-07 08:04:14 +0000 |
commit | 99779070942cf6ff34f7c558fbd256696a993e5d (patch) | |
tree | 2360216bd8e81f69008a3097ea603fa9c3a175af /src/render/lights/qspotlight.cpp | |
parent | bd58f31f23711acda2462f1c1d05728307e625ca (diff) |
Indicate light type
Having a dedicated type field is required not just to make the shaders
cleaner but also to avoid incorrect results when lights get moved around in
the scene. Currently the shaders rely on the direction uniform to distinguish
directional lights from the others, but this cannot work when the elements
in the lights uniform array change, potentially leaving type-specific members
like direction set when a point light takes the same index.
Change-Id: I170e4b471c8cd9b4a23eca49690239c01944b3e6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/lights/qspotlight.cpp')
-rw-r--r-- | src/render/lights/qspotlight.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/render/lights/qspotlight.cpp b/src/render/lights/qspotlight.cpp index b666ef1e1..6b8bf6906 100644 --- a/src/render/lights/qspotlight.cpp +++ b/src/render/lights/qspotlight.cpp @@ -67,7 +67,8 @@ namespace Qt3DRender { \internal */ QSpotLightPrivate::QSpotLightPrivate() - : m_cutOffAngle(45.0f) + : QLightPrivate(QLight::SpotLight) + , m_cutOffAngle(45.0f) { } |