When using SpriteAtlas assets, individual images are also packed when building

We are moving to the (not so) new feature of using a SpriteAtlas asset instead of packing tags, since Unity does not allow using both methods.

When we used packing tags, the Sprite Packer created the atlases for us, and when we built our game, individual images where not included in the target binary, only the atlases (as expected). We are using the Editor log to monitor what assets are packed.

When we moved to a SpriteAtlas asset, we can see both atlas and images are included in the build! this is according to the Editor log:

Used Assets and files from the Resources folder, sorted by uncompressed size:
8.0 mb    2.5% Built-in Texture2D: sactx-1024x2048-Uncompressed-HairAtlas-5c158d62
...
 98.4 kb    0.0% Assets/Sprites/Avatar/FaceImages/Male/F_M_03.png

In this snippet, the atlas includes the image, so I would expect it not to appear in the Editor log, like we have seen when using the legacy sprite packer.

Any ideas why we see that?

Hi @rankornfeld
the issue you described in the post is also happening in our project (Unity 2018.3.11f1 and previous 2018.3 versions as well). It’s strange that images are also being included in builds when you expect to only atlases to be added.

You posted in November 2018, almost 5 months ago.
Have you got new information on that and possibly found a solution?

Thanks!

@Venkify can you help explain the behaviour here?

@rankornfeld @lightmont

The idea of Sprite-Atlas is to pack source textures of as many sprites to a single texture and use it as texture for the sprites in the runtime.

In the log above, sactx-1024x2048-Uncompressed-HairAtlas-5c158d62 (8.0 mb) is the only Texture asset exported.
Assets/Sprites/Avatar/FaceImages/Male/F_M_03.png (98.4kb) represents the Sprite asset only contains Sprite data and not its source texture. Please feel free to ask if you need more info.

2 Likes

Thank you @Venkify
It’s clear now. That’s good news. That means the build size does not increase.