- Home /
Does Effective Usage of SpriteAtlases Double Storage Used?
I've looked extensively through documentation and previously asked questions, to no avail - so I thought I'd bring some attention to this curious matter. I believe SpriteAtlases may effectively double build size. To better understand this, we must first consider two statements:
SpriteAtlases, in order to be bound, when not included in build, must be set via a callback sent via SpriteAtlasManager.atlasRequested. This is an internal event, and cannot be manually triggered. It seems to only fire off when a Sprite is that is bound to a SpriteAtlas not included in build, is activated in the scene. Sprites bound to SpriteAtlases that are included in the build do not fire this event.
Every asset referenced in any scene that is included in the build, will be included in the build.
Looking at these two conditions, it follows that using a SpriteAtlas by conventional means - i.e., setting the SpriteAtlas through a callback when requested - is not possible without including the Sprite in the build as well. This leads to redundant data when the SpriteAtlas is included via an AssetBundle - the texture of the Sprite within the SpriteAtlas is never used, but is included within the build. I've gone through build reports, and sadly, it seems that Sprites that are referenced within scenes and included within SpriteAtlases (that are not included in the build) are included in the build. It should also be noted that in instances where the SpriteAtlas is included in the build, all sprites' textures are included regardless of usage in the scene, and the SpriteAtlas is also packed and included as well - given the SpriteAtlas is referenced within a build scene. Perhaps I'm missing something? Has anyone else experienced this problem, or have a workaround? Build size and redundant data is a real deal-breaker for us, but we also require the great boost to performance that batching brings. SpriteAtlases, when actually used effectively, seem to double the storage used - regardless of inclusion in the build.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Is it possible to implement Batching directly? 1 Answer
Why is atlas and individual sprites included in package? 0 Answers
Custom Sprite Renderer - Batching 0 Answers
Is it possible to utilize iphone dynamic batching with "traditional" animated sprite techniques? 1 Answer