Why Can FairyBatching Still Be Interrupted for UI Elements Using the Same Material?
Why can UI elements using the same material still have their batching interrupted even when FairyBatching is enabled?
FairyBatching primarily adjusts the rendering order of UI elements to create conditions for batching. It does not guarantee that UI elements using the same material will always be batched together. Whether elements can actually be batched is also affected by factors such as mesh complexity, UI hierarchy relationships, and the interleaving of visual effects . For example, when text uses effects such as or , the number of generated vertices can increase significantly. If the mesh complexity exceeds the range allowed by dynamic batching, the UI may still be split into multiple Draw Calls even when the materials are identical and FairyBatching has already adjusted the rendering order. The overlap between the bounding boxes of UI objects can also affect rendering order. When FairyBatching reorganizes the rendering order, it must still preserve the original front to back occlusion relationships. Therefore, when the bounding boxes of different components overlap, UI elements using the same material cannot necessarily be freely rearranged into a continuous rendering sequence. An easily overlooked point is that UI elements appearing visually separate does not necessarily mean that their actual bounding boxes do not overlap. If particles or 3D effects are also interleaved with the UI, the situation becomes more complex. When effects are placed within the UI hierarchy through mechanisms such as , a rendering order such as UI → Effect → UI can cause UI elements that could otherwise be rendered continuously to be split apart. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/eaae27f8 40cb 4282 a1ac e244d9d61ea3.png After enabling FairyBatching, if the Draw Call count remains high, focus on three areas: Check whether the text and UI Mesh contain too many vertices. Check whether the bounding boxes of UI objects overlap. Check whether visual effects or 3D objects are interleaved with the UI rendering order. FairyBatching only attempts to create better conditions for batching. If Draw Calls remain high after it is enabled, you still need to identify which condition is preventing the batching from being maintained.