optimizing lights ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lettucing

so i have light2ds
all values are default (except mode which is set to mix) and shadows are off
yet, when i place too many of them (~10) my fps drop heavily

with no lights

with 10 of them

how can i make it so this doesn’t happen/so that it has a lesser impact on the fps

dynamic lights are very resource intensive specially in godot 3 (in godot 4 this has been reworked iirc)
your best bet would be to reduce the number of dynamic lights you have, or have a baked lightmap instead
seeing your screenshots I would drop lights altogether and use shaders instead

MEDBVLL | 2022-07-29 12:06

Baked lightmaps are only available in 3D, not 2D.

Calinou | 2022-07-30 23:44

:bust_in_silhouette: Reply From: Calinou

Consider using Sprite with additive blending (CanvasItemMaterial) instead of Light2D when possible. It’s much cheaper to render an additive sprite than it is to render a 2D light, especially in Godot 3.x where every 2D light implies an additional render pass.