Search Unity

Question Single Sprite vs SpriteAtlas

Discussion in '2D' started by Nyankoooo, Nov 3, 2020.

  1. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    I'm having multiple Adressables with around 5 .png files that are rather large (1080x1080px), and I'm using these always separately in my scene. This means that they're never on the screen at the same time.

    Now I'm wondering if it is better to simply keep these files separate of each other, or slight scale them and eg. fit 4 of them into a SpriteAtlas for better(?) performance or other advantages.
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi @MardukCorp,

    The decision of having them separated or integrated on an atlas with a smaller resolution depends on multiple factors.

    Some of them are:
    • How much memory your game is using on the targeted lower-end device
    • How much quality is lost while making your images smaller
    • How frequent are the images used/swapped
    • How fast you would like to have the respective images switched
    Depends on the answers to these considerations you can make the right decision.


    Good luck with it!
     
  3. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    Hi @DiegoDePalacio, thank you for the details!

    The most important things are that the images would be swapped quite frequently and switching them should happen as quickly as possible.
     
  4. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Ok, in that case, it's probably better to use a SpriteAtlas if the visual quality is good enough ;)