diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-05-24 12:09:44 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-05-24 12:10:02 +0100 |
commit | 77d294db076dac19e8b549b445ffede9f7260c84 (patch) | |
tree | 828ee7a6862ec5c0bd24f97cb540625a2c647376 /src/render/jobs/lightgatherer.cpp | |
parent | 59f8fec8a41606b3185fe3a4e276978e3e1ed5ef (diff) | |
parent | 939b9b4b7591e8a421cf048a0a84ed3e75d81d21 (diff) |
Merge branch 'dev' into wip/animationwip/animation
Change-Id: I6e770609c90a7745d08fa4e2f424e865678c5d6f
Diffstat (limited to 'src/render/jobs/lightgatherer.cpp')
-rw-r--r-- | src/render/jobs/lightgatherer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/render/jobs/lightgatherer.cpp b/src/render/jobs/lightgatherer.cpp index 39023bc35..e62544f15 100644 --- a/src/render/jobs/lightgatherer.cpp +++ b/src/render/jobs/lightgatherer.cpp @@ -51,6 +51,7 @@ namespace Render { LightGatherer::LightGatherer() : Qt3DCore::QAspectJob() , m_manager(nullptr) + , m_environmentLight(nullptr) { SET_JOB_RUN_STAT_TYPE(this, JobTypes::LightGathering, 0); } @@ -58,13 +59,21 @@ LightGatherer::LightGatherer() void LightGatherer::run() { const QVector<HEntity> handles = m_manager->activeHandles(); + int envLightCount = 0; for (const HEntity handle : handles) { Entity *node = m_manager->data(handle); const QVector<Light *> lights = node->renderComponents<Light>(); if (!lights.isEmpty()) m_lights.push_back(LightSource(node, lights)); + const QVector<EnvironmentLight *> envLights = node->renderComponents<EnvironmentLight>(); + envLightCount += envLights.size(); + if (!envLights.isEmpty() && !m_environmentLight) + m_environmentLight = envLights.first(); } + + if (envLightCount > 1) + qWarning() << "More than one environment light found, extra instances are ignored"; } } // Render |