how to reduce draw calls of my GridContainer's Item (64 items use 128 draw calls)

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

I make ItemSlot scene with panel and texture on it


then when I instance 64 of it to GridContainer it cost 128 draw calls
why is it not batching?

batching work fine when I turn off visible on texture left only panel visible

|->texture x

this cost only 1 draw calls

why it uses so many draw calls and how I make batching work with texture on it

figure it out,
to make batching work you must separate its drawlayer.

currently, I make Node2D on top of texture and set its z_index to 4000


still not a good solution but at least it works.

sry295 | 2021-10-28 02:02