-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single PointLight2D causes extreme lag on Android #81152
Comments
The Vulkan Mobile rendering backend is high-end oriented, while your device is over 4 years old and also a mid-range device. Try using the Compatibility rendering method instead. It's also worth trying to render to a lower resolution using the |
Using compatibility rendering method didn't have any effect on frame rate (I assume it's the 'Compatibility' option in the top right corner.). Halving the resolution down to 1170x540 did increase the FPS, I was even able to add 2 more light nodes before the frame rate dropped. I also asked someone to run the apk on their Samsung Galaxy S23 Ultra and it runs smoothly in native resolution at 120 FPS when there are less than 20 light nodes and still runs above 60 FPS with more than thousand light nodes. While I agree my device is potato compared to S23U, I do not think it should cause such a huge drop in performance with just one light node, because it can run games like Asphalt 9 with reasonable resolution and FPS with 3D graphics, light, shadows and reflections. |
Unfortunately, no. You need to open the Project Settings and change Rendering Method.mobile to |
Thank you, that improved the FPS to 58 even in native resolution. So lowering the resolution along with this option should do the trick (although I do feel this is not optimal, I do not have any idea about Godot internals so I won't argue what is possible or not). Are there any drawbacks of exporting 2d project with gl_compatibility? I guess this is not something that can be changed after exporting project? Like encapsulating this option into something like "high graphics" and "low graphics" option to end users? |
The biggest thing I can think of is inability to use instance shader parameters (they can come useful in 2d not just 3d). As for your question, IIRC there's an open proposal for something like that. |
For mobile, we recommend Compatibility as it's the only rendering method that works reliably on older/low-end devices. The Mobile rendering method is high-end-oriented. It is possible to provide a run-time selection that is effective after a restart (by writing |
I did a bit of testing related to this on another PR and I have a diff that helps. On my device (Pixel 4) it brings the performance back up to 60 FPS. I modified the MRP a bit to make it stress the GPU more by adding 16 lights total. On my Laptop (with iGPU) performance of the modified MRP goes from 240 FPS to 370 FPS
After: |
A potential fix has been merged for this in #90920, please test 4.3-dev6 when it's released in a few days if you can, and confirm whether this solves the lag issue. |
Godot version
v4.1.1.stable.official [bd6af8e]
System information
Android 13 - Vulkan (Mobile), Device - Redmi Note 7 Pro, CPU - Qualcomm Snapdragon 675 Octa-core upto 2.0GHz, GPU - Adreno 612 GPU upto 845MHz, Display - 2340x1080 FHD+ 409 PPI
Issue description
I made a test scene with 3 nodes - Fullscreen
ColorRect
,Sprite2D
,PointLight2D
. Whenever the light is in the active area, FPS reduces to 42 from 60. Is this an expected behaviour with Light2D? Seems like either I am doing something totally wrong or the light nodes are not at all usable for mobile games.60 FPS with light off:
Steps to reproduce
Attaching the test project below. Just one click run on an android device.
Minimal reproduction project
Light2DTest.zip
The text was updated successfully, but these errors were encountered: