Why is each UI Element a separate draw call?

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

I created a test scene with a Grid Container containing 135 panels. Please take a look at the images that I have linked:

After running the test scene, I found out that each panel needs one draw call. Thats 135 draw calls for just the ui. Is it possible to batch these, to reduce the draw calls?

Godot Engine 3.2.3 stable
GLES2 Renderer

:bust_in_silhouette: Reply From: Calinou

If you use Godot 3.2.2 or later, switch to the GLES2 renderer to benefit from 2D batching.

GLES3 batching will be added in a future 3.2.x release: https://github.com/godotengine/godot/pull/42119

The Vulkan renderer in the master branch doesn’t support batching, but since draw calls are much cheaper in Vulkan compared to OpenGL, it’s not really an issue in practice.

Hi. I forgot to mention my godot version. Here it is:
Godot Engine 3.2.3 stable
GLES2 Renderer

In the “Rendering” tab in settings, under “Batching”, I have “Use Batching” and “Use Batching in Editor” enabled. However, as you can see, the draw call is still enormously high (same as the one in the picture), which is kind of weird. So I’m not sure why it is so high.

I tried applying one shared material across all the panels, yet it didnt change anything.

ggez | 2020-10-15 10:42