Skip to content

Commit

Permalink
Merge pull request #71584 from clayjohn/SDFGI-error
Browse files Browse the repository at this point in the history
Remove light from dynamic light list when removing scenario
  • Loading branch information
akien-mga committed Jan 18, 2023
2 parents 0461f75 + b2a31a3 commit e514e37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions servers/rendering/renderer_scene_cull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,10 @@ void RendererSceneCull::instance_set_scenario(RID p_instance, RID p_scenario) {
switch (instance->base_type) {
case RS::INSTANCE_LIGHT: {
InstanceLightData *light = static_cast<InstanceLightData *>(instance->base_data);
if (instance->visible && RSG::light_storage->light_get_type(instance->base) != RS::LIGHT_DIRECTIONAL && light->bake_mode == RS::LIGHT_BAKE_DYNAMIC) {
instance->scenario->dynamic_lights.erase(light->instance);
}

#ifdef DEBUG_ENABLED
if (light->geometries.size()) {
ERR_PRINT("BUG, indexing did not unpair geometries from light.");
Expand Down

0 comments on commit e514e37

Please sign in to comment.