0 votes

I'm making a mobile game with some Light2D and normal Maps for the sprites. On desktop it works pretty fine. But when I run it on my middle-class mobile phone the FPS falls down 50 with only 2 lights.
Is there some way to use Light2D and normalmaps for mobile-dev, or should I forgo this?

Additional Info:
I used a lot of individual texture and normal map files. Off course batching was not very successfull so. This was no recognizeable performance problem anyway. But because of the light problem I tried using Texture Atlases instead. So without lighting the batching worked fine, but with lighting the batching hardly did anything.

I need to render around 50 Sprites and 6 Lights on Screen. The whole scene should be able to contain 500 Sprites and 20 Lights.

Thanks a lot for help!

Godot version 3.4
in Engine by (15 points)

1 Answer

0 votes
Best answer

In Godot 3.x, 2D lights are rendered with a multipass approach, which is very slow when you have several lights. Also, make sure to avoid very large sprites as these will have to be redrawn entirely every time a light touches them. Godot 4.0 will use single-pass lighting in 2D, which is much faster.

As a workaround, you can reduce the rendering resolution of the project by using the viewport stretch mode and using a base window size such as 1280×720 (or 720×1280) in portrait mode, possibly even less. See Multiple resolutions in the documentation for more information.
Even then, this may not be enough, so using sprites with an additive blend mode will likely be the only alternative. These can't have shadows or normal maps though.

by (11,917 points)
selected by

Ok I see. Thank you for the fast answer! I will use the "additive blend mode" approach.
It just would had been a nice to have and the game mechanics doesn't depend on it.

Looking forward godot 4.0!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.