Using more Canvases
A Canvas component's primary task is to manage the meshes that are used to draw the UI elements beneath them in the Hierarchy window and issue the draw calls necessary to render those elements. An important task of the Canvas is to batch these meshes together (which can only happen if they share the same Material) to reduce draw calls. However, when changes are made to a Canvas, or any of its children, this is known as dirtying the Canvas.
When a Canvas is dirty, it needs to regenerate meshes for all of the UI elements beneath it before it can issue a draw call. This regeneration process is not a simple task and is a common source of performance problems in Unity projects because, unfortunately, many things can cause the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access