Image Atlasing

From PowerUI
Jump to: navigation, search

By default, all images on your UI are automatically atlased (merged into a single texture) so PowerUI can optimize the amount of draw calls. This process happens entirely in the background and generally doesn't need much attention. It also doesn't apply to video's or animations - they are "isolated" from the atlasing system. However, if you'd like to turn it off (typically to reduce memory usage), then there's a few options to do just that.

Disabling it entirely

To turn it off on the, run this before you write any HTML to it (e.g. in Awake):

// Turn off atlasing for the main UI:
UI.RenderMode = Css.RenderMode.NoAtlas;

// For a world UI:
worldUI.RenderMode = Css.RenderMode.NoAtlas;

Disabling it for a particular image

PowerUI provides the on-atlas CSS property to force particular images to never join the atlas:

on-atlas:0

Filtering isolates images too

If an image specifies a custom filter-mode then it will also be isolated (not added to the atlas). This is because every other image would have to use the same filtering (as it would be applied to the atlas itself).