Workarounds for slow 2d drawing?

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

My project has a lot of Polygon2Ds which are generated in code. They’re static - created in the editor with tool scripts but they don’t change in game. It runs at 60fps on my high-end laptop, but below 20 on my Android.

According to this bug, 2d drawing performance is quite poor at the moment. I’ve tried GLES2 and 3, and using _draw instead of Polygon2Ds, but all were the same.

I looked at 2D shaders but I don’t have any experience with that, and it didn’t seem like I could easily draw filled polygons from a list of vertices (would happily be wrong).

Also wondering about drawing with GDNative, if it would be faster or just face the same issues?

Also wondering about drawing with GDNative, if it would be faster or just face the same issues?

It will face the same issues, as the bottleneck is likely to be in the rendering code. This should be fixed in Godot 4.0 when the 2D renderer is rewritten to be more efficient.

Calinou | 2019-06-10 20:09