- Home /
What is the benefit of SpritePacker?
I've read the documentation but it's still not 100% clear for me.
In my project, i have around 1000 single sprites, for around 30 animations. I'm not sure if i should give a tag to each different set of sprites or not and if i do, will it even benefit me in any way? or will it just create an overhead of the atlas as well?
what does the atlas actually do? cause from what i understand, instead of loading each sprite for my animations, it loads the pages from the atlas, and pulls from there like, instead of loading 300 sprites, it loads 13 atlas pages.
Answer by _joe_ · Apr 12, 2015 at 05:24 PM
It might be better to know what an atlas is.
An Atlas is a texture, which simply has many sprites, but what's powerful about it, is that it comes with a map file (a text file that we don't see), that tell where each sprite is and how big it is.
So basically, if all your game is using only 1 atlas, only 1 texture will be used, in addition to the map file (which is a text file that tells what goes where), the whole game will run with only 1 texture loaded into memory, which increases both visual rendering (draw calls), and physical memory (loaded assets).
when i pack my sprites, i got many many atlases, according to each tag i used for packing.
I got around 30 atlases, and most have around 10 pages.
So maybe i'm just doing it wrong? should i give all my textures the same tag, so they will be in only 1 atlas?
also, when an atlas has pages, is it just so it will be easy for me to see, or does each page corresponds to a new texture in the atlas?
and lastly, the most important question my main issue was with loading time. won't it takes a long time to load one huge texture?
in the sprite setting, you can set the Sprite pack you want that texture to be. Then they get combined but based on the platform you are developing, you are limited in size of the texture so adding them all to one single pack will not do since they will not all fit. Or if you sprite is already 4096*4096 then it will probably occupy most of the sprite packer.