Is it bad to have multiple Canvas widgets if only one is visible at a time?

Hey everyone,

I’ve heard that having multiple Canvas widgets in a UI hierarchy can negatively impact performance.

However, I’m wondering if this performance hit still applies if only one of the Canvas widgets is visible at any given time. For example, if I’m using a Switcher widget where each child is a Canvas, does the rendering engine still process the invisible ones?

Any insights or best practices on this would be greatly appreciated.

AFAIK, Canvas performance issues are related to a few things.

  1. Mobile or handheld devices.
  2. Overdraws. Widgets that overlap.
  3. Performance scales inversely with number of widgets.
  4. Lots of draw calls if lots of widgets with different textures.

On PC, I’ve never noticed any issues using as many as you want. Canvas that are not visible still affect performance, but only in certain conditions. They don’t affect draw calls. But if they update, have tick enabled, etc, they will consume that CPU time. Also, they are part of the hierarchy, so they must be culled by the CPU. Also, any child widget on those hidden Canvasses that have textures, those textures will remain in memory. As to the specific CPU/GPU memory management, I’m not sure if they can be swapped out of GPU memory, but I would guess it would try to keep as much on the GPU as possible so that it’s available when you switch to a new panel.

Simple widgets with no textures have almost negligible performance cost.

So disable ticking for inactive widgets. Disable tick on everything you can. Use event driven updates where possible.

The Switcher sets inactive panels to Collapsed. This is better than Hidden as Collapsed does not draw at all. Check that it is being set correctly at runtime. So to answer your question, inactive canvas in your switcher widget will likely have no impact on performance if it’s behaving correctly.

Texture atlas might be worth it if you have lots of widgets with textures.

I think ‘stat UMG’ in the console and the Widget Reflector can help with auditing performance issues.

But yeah, on PC, I don’t think it’s an issue unless you go nuts with the widget count.