It’s time for another graphics optimisation tip and today I’ll be covering texture atlases.

Minimising the Number of Texture Atlases

Each texture atlas consumes valuable memory. To minimise the number of atlases, try to pack as many frames into each one as possible. A good trick here is to scale your bitmaps down to about 80% of their intended size then scale your sprites back up at run-time. Gamers will never notice the difference and you’ll possibly reduce your game’s memory overhead by a few texture atlases.

Having fewer atlases is also important for performance. On each screen draw, the GPU has to swap between each texture atlas to render your game’s current frame. Swapping between atlases is expensive. Too many swaps per frame redraw and it’s likely that your game won’t be able to maintain a steady 60 frames per second. You can also help the GPU here by keeping textures that sit next to each other in the display list within the same atlas.