Hello,
We are looking at optimizing our UMG widgets when it comes to reducing draw calls (via RenderDoc). We noticed that there are quite a bit of widgets are not being batched properly (using Slate.ShowBatching in editor) and it’s probably due to poor layout in the widget hierarchy.
We would like to understand what are the concrete rules under the hood that govern widget batching and what all can we do to ensure efficient widget batching.
Thanks in advance,
Arnav
Hi Arnav,
I gave a talk last year at Unreal Fest on draw call reduction that you can find here, I focused on mobile (since other platforms don’t tend to care so much about draw call count) but the information should apply to other platforms as well. The biggest thing you’ll want to do right away is enable “Explicit Canvas Child ZOrder” in your project settings. By default we increment the layer (and the draw call) for each widget on a canvas so that z-order can be determined by the order in which things are listed in the hierarchy, but enabling this setting will batch things that share a z-order as specified on the slot settings. Beyond that, overlays and canvas panels are the two biggest offenders for increasing layer/draw call count (overlays will increment for each child), so those would be the first things to look at. You could also look into using atlassing if you have many textures that display together so that they can share a draw call, though that comes with the tradeoff of having to load the entire atlas to use any part of it.
Best,
Cody