Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

SpriteAtlas needs better or custom packing

Discussion in '2D' started by adbourdages, Jul 11, 2018.

  1. adbourdages

    adbourdages

    Joined:
    Jul 8, 2012
    Posts:
    75
    Hey all,

    We recently upgraded a project to 2018.1 and great improvement to the workflow with the SpriteAtlas, well done. However I think all the developers could use some better packing algorithms for those atlases.

    Attached are the same sprites packed with the SpriteAtlas (allowRotation, tightPacking, padding=2) and TexturePacker (Polygon Outline). SpriteAtlas produces a 1024x1024 image while TexturePacker manages a 512x1024.

    On the UI atlas, with SpriteAtlas (padding=2, no rotation, no tightPacking) produces 3 images 2048x2048, 2048x2048 and 512x512. TexturePacker (MaxRect) generates images that are 30% smaller.

    I have played with all the variable that I have access to to try to create smaller atlas with SpriteAtlas but to no avail. Going forward pretty much everyone will use SpriteAtlas so it would be nice to get a size improvement on this front.

    In addition, the workflow to make the sprites are as big as possible to just fill a 2k atlas is horrendous. It requires resizing the sprite in an external tool, then re-pack. Rinse and repeat until you have found just the right scaling. It would be super easy to add a scaling parameter in the SpriteAtlas directly and scale all the sprites with that value (plus our choice of scaling algorithm would be awesome). Note that this has nothing to do with the Pixel Per Unit values on the sprite.
     

    Attached Files:

    VincentZhou1988 and Xarbrough like this.