Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Texture Packer vs Sprite Packer for sprite in UI

Discussion in 'UGUI & TextMesh Pro' started by Yuko29, Apr 20, 2015.

  1. Yuko29

    Yuko29

    Joined:
    Apr 15, 2015
    Posts:
    1
    Hi All,

    I don't know if it's better to use Texture Packer or Sprite Packer to reduce my draw calls.
    With texture packer I can control my atlas, but Sprite Packer is a little uncontrollable.
    When I put in the import the Packing Tag with the same tag for all my sprites, sometimes Unity creates several atlas or other times the atlas don't show in the sprite packer, it's funny...

    So my question is what's the best aproach for sprite and reduce draw calls in my project?

    Another question, I don't know how to access to a sprite inside a atlas by code. How can I do that? (By code, I know that it's possible if I have the reference but this is not the case)
     
  2. Goodeddie

    Goodeddie

    Joined:
    Aug 3, 2016
    Posts:
    79
    I'm bumping this post.

    I don't think you reference the atlas manually. You reference the texture in your animation and when you play or you build the game, unity will create the atlas behind the scenes and use that instead.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,146
    For the sprite packer, the atlas doesn't exist till you build out I believe. So in this case you'd have a bunch of smaller single images that you tell unity to pack up. Or, you can have your own sprite sheet and split it into multiple sprites in the sprite editor.

    You just access any sprites normally and let Unity handle the atlas for you.
     
  4. Goodeddie

    Goodeddie

    Joined:
    Aug 3, 2016
    Posts:
    79
    The funny thing is that, if you use a sprite sheet, you will have to split it into multiple sprites using the sprite editor and then you'll have to pack it back up again into an atlas. Is that double the work as opposed to using already split up single images and then just packing them together at the end?
     
  5. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,146
    It depends. If you have an artist who makes a sprite sheet, you can pull that in, all the images are nicely laid out and you can do the splits yourself.
    Depending on the size of the sprite sheet, you can include it in a atlas with the sprite packer and it will combine them.
    I don't know if you'll get anything extra by doing this, other than maybe being a bit more organized perhaps.

    I have a little of both in my project. I have an asset that will take a photoshop file, split the layers and make a sprite sheet and already cut out the pieces for you, so I don't have to do that step. So it's pretty easy just to include those sprite sheets into a sprite packer atlas.
     
  6. soaring

    soaring

    Joined:
    Jun 22, 2015
    Posts:
    27