Light2D eats up FPS in Godot 2.1

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

I’m working on a 2D platformer game in which I set up 2 Light2D nodes, in Godot 2.1.4. One on the Player and one in the background. Because I was working on a good PC there wasn’t any problems, but when trying it out on my laptop, the frame rate drops very significantly, making it almost unplayable. Tried a few things and found out the Light2D nodes were the culprit, when turning them off the frame rate gets back to normal just like when on my PC.
Is there any way to make the game run nicely with older hardware without turning off the Light2D nodes, because it’s a very simple platformer and no real reason why it shouldn’t run smoothly.
Thanks for any tips!

Have you tried playing around with the Light2D parameters? Failing that, maybe there’s a place in the code where you’re frequently calling it, and it’s unnecessary to call Light2D so much.

Ertain | 2018-01-06 21:00

2D lights are known to be quite slow in Godot. As a workaround, you can use additive Sprites instead of Light2D nodes. It won’t support shadows, but is much faster.

Calinou | 2018-01-07 12:45

Thanks, I will probably add an option in the settings menu to turn of Lights and use Sprites just like you suggested, if the user has problems with fps.

Luka38 | 2018-01-07 18:32

This is still a problem in Godot 3.1. I just discovered that Light2Ds cause very volatile FPS changes in my project.

@Calinou, what is the method of additive sprites? Can you describe it for me, so that I can implement it?

Diet Estus | 2019-04-21 18:35

I too am interested in the way of implementing additive sprites instead of Light2d, but whatever I tried so far it had not the same visual result as Light2D. Would be nice if someone would lead me the solution.

YalcinA | 2019-07-28 18:48

Then let’s hope this gets ironed out in the Vulcan implementation of the engine.

Ertain | 2019-07-28 19:46