Why do i need "Sprite Packer" if i'm already using "Packing Tag" in my 2D game

Hi All,

I’m building a 2D game and i’m using “Packing Tag” to pack my Sprites and save batches.

My questions is: Why do we need the “Sprite Packer” to put the icons in one sheet, isn’t it already done when using the “Packing Tag”?

The packing tab is like a table of contents for the sprite packer… It tell it which “page” to put the sprite on. This makes it possible to group sprites into an atlas by specifying the same packing tab for those sprites. For example, you may have sprites for world 1 with packing tab of world_1, the end result is that all of those are packed into the same atlas. (I’m purposefully simplifying this by ignoring compression)

Thanks,

So i understand the “Sprite Packer” is only viewer for my sprite sheets that are automatically created after assigning the “packing tag”?
And unless i want to change the “Packer policy” i don’t really have to open it. Right?

Not really. The sprite packer is responsible for packing the sprites into the sheets (atlases). You can view the sprite sheets manually if you want to inspect how they are packed. The packer policy gives some additional control over what the packing process does to place all the sprites into an atlas. I don’t think I have ever had the need to change it.

The packing tag allows you to specify an atlas to pack a sprite to. If you leave it blank, the packer will try to pack all of your sprites into a default single atlas if it can. Some things make it pack into another atlas, for example: setting a single sprite to a higher color depth than the others in the atlas.

At its core, all the sprite packer does is create a very large sprite (aka: atlas) from many single sprites. This saves draw calls when using multiple sprites. Every time the gpu has to fetch another sprite, it needs an additional draw call. If the gpu only needs to fetch a single, large sprite (atlas), it can simply use pieces of that large sprite for individual sprites, thus saving on draw calls.

2 Likes

Thanks, spryx!