diff --git a/src/engine/graphics/model/mdlreader.cpp b/src/engine/graphics/model/mdlreader.cpp index 4978213d..37c1a4f9 100644 --- a/src/engine/graphics/model/mdlreader.cpp +++ b/src/engine/graphics/model/mdlreader.cpp @@ -527,6 +527,7 @@ shared_ptr MdlReader::readLight() { light->affectDynamic = static_cast(affectDynamic); light->shadow = static_cast(shadow); light->flareRadius = flareRadius; + light->fading = static_cast(fading); int numFlares = static_cast(flareTexturesArrayDef.count); if (numFlares > 0) { diff --git a/src/engine/graphics/model/modelnode.h b/src/engine/graphics/model/modelnode.h index eb46e4c9..6ee3213b 100644 --- a/src/engine/graphics/model/modelnode.h +++ b/src/engine/graphics/model/modelnode.h @@ -121,6 +121,7 @@ public: bool ambientOnly { false }; bool affectDynamic { false }; bool shadow { false }; + bool fading { false }; float flareRadius { 0.0f }; std::vector flares; }; diff --git a/src/engine/scene/node/light.cpp b/src/engine/scene/node/light.cpp index b0e2ba84..f6f11c21 100644 --- a/src/engine/scene/node/light.cpp +++ b/src/engine/scene/node/light.cpp @@ -53,10 +53,10 @@ void LightSceneNode::update(float dt) { if (_active) { // Fade out - _fadeFactor = glm::max(0.0f, _fadeFactor - kFadeSpeed * dt); + _fadeFactor = _modelNode->light()->fading ? glm::max(0.0f, _fadeFactor - kFadeSpeed * dt) : 0.0f; } else { // Fade in - _fadeFactor = glm::min(1.0f, _fadeFactor + kFadeSpeed * dt); + _fadeFactor = _modelNode->light()->fading ? glm::min(1.0f, _fadeFactor + kFadeSpeed * dt) : 1.0f; } }