Graphics/RenderSystem: Fix light removal
This commit is contained in:
parent
de7fee348a
commit
d113b58b5a
|
|
@ -199,10 +199,9 @@ namespace Nz
|
||||||
m_newlyHiddenLightEntities.erase(entity);
|
m_newlyHiddenLightEntities.erase(entity);
|
||||||
m_newlyVisibleLightEntities.erase(entity);
|
m_newlyVisibleLightEntities.erase(entity);
|
||||||
|
|
||||||
GraphicsComponent& entityGfx = registry.get<GraphicsComponent>(entity);
|
LightComponent& entityLight = registry.get<LightComponent>(entity);
|
||||||
const WorldInstancePtr& worldInstance = entityGfx.GetWorldInstance();
|
for (const auto& lightEntry : entityLight.GetLights())
|
||||||
for (const auto& renderableEntry : entityGfx.GetRenderables())
|
m_pipeline->UnregisterLight(lightEntry.light.get());
|
||||||
m_pipeline->UnregisterInstancedDrawable(worldInstance, renderableEntry.renderable.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderSystem::OnNodeDestroy(entt::registry& registry, entt::entity entity)
|
void RenderSystem::OnNodeDestroy(entt::registry& registry, entt::entity entity)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue