Search Unity

Sprite Atlas not using optimum size

Discussion in '2D' started by gary_bbgames, Nov 19, 2013.

  1. gary_bbgames

    gary_bbgames

    Joined:
    Jan 20, 2012
    Posts:
    22
    Hey guys, my game has 32 x 32 pixel tiles. The sprite atlas Unity Pro is creating is 256 x 256. You would think 8 by 8 sprites right? It's actually doing 7 x 7 and stretching them. This makes them look muddy in the game. Is it possible to specify the atlas size, or to tell Unity not to stretch them?
     
  2. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    It should not be stretching them. Instead it adds borders around your packed sprite so there are no filtering artifacts.
    A 256x256 atlas will not fit 8 32x32 sprites by design.

    If you think it is actually streching them, please submit a bug report.
     
  3. gary_bbgames

    gary_bbgames

    Joined:
    Jan 20, 2012
    Posts:
    22
    It's hard to say what it's doing exactly. I'd be happy with 7 x 7 and space as long as it kept the quality the same. Here I have attached a screen grab of the atlas and the original image. It's much worse quality.
    $Screen Shot 2013-11-19 at 15.25.36.png
    $t_39.png
    You can see there is a load of "noise" in the sprite sheet.
     
  4. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    Hard to tell without seeing source assets. However it is using PVRTC compression. Try changing your source textures to RGBA and then rebuild the atlas.
     
  5. gary_bbgames

    gary_bbgames

    Joined:
    Jan 20, 2012
    Posts:
    22
    Oh man! What a pillock I was! Thanks for spotting that. Moved to RGBA and it's all good :rolleyes:
     
  6. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256