About Texture Atlases

Combine your app’s image files automatically into one or more large images, called texture atlases, for improved app performance.

A texture atlas provides a way to improve the performance of your apps by combining all of the app’s image assets into one or more large images. This provides you with a way to improve the performance of your app by drawing multiple images with a single draw call.

During build time, the compiler looks for any folders with the naming format of name.atlas. After those folders have been identified, all of the images within the folders are combined into one or more large image files. Texture atlases are automatically available to apps that include the Sprite Kit framework. You can use texture atlases in apps that don’t enable Sprite Kit by setting the Enable Texture Atlas Generation build setting in Xcode and manually reading the generated .plist. This build setting appears in the build setting list only if you have a .atlas folder in your project. The following image shows four image files combined into a single image file.

The following diagram shows four individual images combined into a single texture atlas image.

../Art/texture-stitches_2x.png

After the app is built, new folders are created with a .atlasc suffix and placed in your app bundle’s Resource folder. Those new images are automatically rotated and trimmed to fit the maximum number of images into a single file, one whose images and orientation are tracked by a property list (.plist) associated with the folder. You do not need to change your code in order to use the texture atlas feature.

When generating the .atlasc folders and image files, the following rules apply:

  • Each compiled image has a maximum size of 2000 x 2000 pixels.

  • After an image has reached its maximum size, a new image is created.

  • Images for the same device are kept together—for example, all iPhone images are in one file (~iphone.1.png), and all iPad images are in another file (-ipad.1.png).