Sprite atlas basic question

Hello everyone,

I’m not totally sure I understand how sprite atlases work in Unity, so I’d like to get a confirmation from you.

I proceed as follows:

  • For the purpose of my UI, I create a series of separate sprites, each from a different image
  • I use the corresponding sprites into my UI
  • Then I create a sprite atlas to gather all these sprites (after enabling the Sprite Packer in the Project Settings)

My question is: is this procedure enough for Unity to use the sprites from the atlas instead of the original sprites?
I ask this because when I run the project and look at the properties of the sprites used ingame, Unity always shows me the original sprite as Source Image, not the atlas sprite.

Maybe I misunderstood or forgot something.

How do you get sure Unity uses the atlas sprites instead of the original ones ?

Thank you in advance for your help.

if you open the stats window you will see less draw calls if the sprite atlas is being used correctly

The steps you described look correct.

Some additional techniques you can use to test if texture atlas are working and draw calls are batched togehter:

  • Sprite.Texture field. According to docs it should point to atlas texture if it’s being used. Unity - Scripting API: Sprite.texture
  • Unity builtin frame debugger this should not only give you information of what texture get’s used but also other reasons why draw calls aren’t batched. Unity - Manual: Debug frames in Unity
  • External frame debugging tools like RenderDoc which can be used with standalone builds of your game.