Many Light2d's become very slow, is there a more lightweight solution available?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By miztaw
:warning: Old Version Published before Godot 3 was released.

I was experimenting with Godot to create an isometric (2D) RTS game visually similar to the early command & conquer franchise. Since light should become an important aspect in my game, I created a little stresstest with a simple tank-model, which consists of a KinematicBody2D, it’s CollisionShape2D, an AnimatedSprite (with an animation /1 sprite for each of the 8 movement directions) and a Light2D to create a nice lighting around the unit, similar to the isometric demo.

On my notebook, which has no dedicated GPU and a quite old CPU the framerate drops after adding only 20 tank scenes. My friends notebook can handle 160 of those, which seems okayish, but not what I’m aiming for.

So here comes my question: Is there any more feasible way to achieve this lighting effect? I was thinking about some screen-overlay - like the canvas modulate I use - where I’ll stencil out the ellipses of lighting for each frame and unit on screen.
I was wondering if that’s possible using shaders, but I guess it’s not, since all of the unit’s shader materials would have to work on one instance of the overlay - and I really don’t know if that’s possible.

Any help would be appreciated!

Maybe some additional information: I don’t really want to create shadows or use any LightOccluders with this kind of light. Also an area which is luminated by multiple “lights” doesn’t have to be more lit, than the area of a single light source. Coloured lights would be a huge plus.

miztaw | 2017-08-28 17:11