From d866517708f669a3cc73847f440c9c1710d1338b Mon Sep 17 00:00:00 2001 From: Weizhen Huang Date: Mon, 18 Aug 2025 11:33:38 +0200 Subject: [PATCH] Fix #144639: light missing update because it was disabled the `light->is_enabled` check was only intended for background light, for other light types we need to recompute the contribution at each update. --- intern/cycles/scene/light.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp index 8d82b0b2000..07499e009ee 100644 --- a/intern/cycles/scene/light.cpp +++ b/intern/cycles/scene/light.cpp @@ -157,7 +157,7 @@ bool Light::has_contribution(const Scene *scene, const Object *object) return false; } if (light_type == LIGHT_BACKGROUND) { - return true; + return is_enabled; } if (light_type == LIGHT_AREA) { if ((get_sizeu() * get_sizev() * get_size() == 0.0f) || @@ -264,13 +264,12 @@ void LightManager::test_enabled_lights(Scene *scene) } Light *light = static_cast(object->get_geometry()); + light->is_enabled = light->has_contribution(scene, object); + has_portal |= light->is_portal; if (!light->is_enabled) { continue; } - light->is_enabled = light->has_contribution(scene, object); - has_portal |= light->is_portal; - if (light->light_type == LIGHT_BACKGROUND) { background_lights.push_back(light); }