Version: Unity 6.0 (6000.0)
Language : English
Sprite atlases
Create lower resolution versions of sprite atlases

Create a sprite atlas

Create a sprite atlasGraphics: A utility that packs several sprite textures tightly together within a single texture known as an atlas. More info. 2D: A texture that is composed of several smaller textures. Also referred to as a texture atlas, image sprite, sprite sheet or packed texture. More info.
See in Glossary
and pack spritesA 2D graphic objects. If you are used to working in 3D, Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. More info
See in Glossary
into it.

Note: You can also create multiple sprites from a single texture instead. For more information, refer to Import a sprite or spritesheet texture and Cut out sprites from a texture.

Prepare sprites for packing

To optimize the performance of sprite atlases and the memory they use, do the following for each texture you want to pack:

  • Disable Read/Write unless you read or write to the texture in C# scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
    See in Glossary
    .
  • Enable Tight Packing to reduce the number of transparent pixelsThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
    See in Glossary
    around the sprite.

Select Open Sprite Editor and check the following:

  • The Custom Outline tab, to make sure the outline fits closely to the sprite. For more information, refer to Crop a sprite.
  • The Secondary Textures tab, to make sure the sprite has the same number of secondary textures as the other sprites you want to pack it with. Otherwise the combined secondary textures in the sprite atlas might contain a lot of empty space. For more information, refer to Add normal map and mask map textures to a sprite.

Create a sprite atlas

To create a sprite atlas, from the main menu, go to Assets > Create > 2D > Sprite Atlas.

Unity creates a file with a .spriteatlasv2 file extension in the Project window. Unity no longer uses Sprite Atlas V1 format by default. For more information, refer to Convert Sprite Atlas V1 assets.

Add sprites to a sprite atlas

For more information about assigning sprites to different sprite atlases, refer to Sprite atlases.

  1. In the Project window, select the sprite atlas asset.

  2. To add a sprite to the sprite atlas, drag a sprite from the Project window onto the Objects for Packing label in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
    See in Glossary
    window.

    You can drag sprites, textures, or folders onto the Objects for Packing label. You can also select the Add (+) button in the Objects for Packing section.

  3. Select Pack Preview to display the packed texture in the Preview window at the bottom of the Inspector window.

If your textures have normal mapsA type of Bump Map texture that allows you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry.
See in Glossary
or mask maps as secondary textures, select the dropdown at the top-right of the Preview window to display the combined secondary textures.

Sprites now render using their sprite atlas texture in the SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
view, the Game view, and in Play mode. Unity also includes sprite atlases in your builds by default, and automatically loads and uses them at runtime.

Note: If you add a sprite to multiple sprite atlases, Unity randomly chooses which sprite atlas texture to use at runtime. To avoid this, refer to Load sprite atlases manually at runtime.

Use the original textures while editing

To use the original unpacked textures in the Scene viewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary
and Game view, but keep using the sprite atlas textures in Play mode and at runtime, follow these steps:

  1. From the main menu, select Edit > Project Settings.
  2. Select Editor.
  3. In the Sprite Atlas section, set Mode to Sprite Atlas V2 - Enabled for Builds. Unity now builds and uses sprite atlases only when you enter Play mode or build your project.

For information on other Mode values, refer to Editor settings.

Additional resources

Sprite atlases
Create lower resolution versions of sprite atlases