Search Unity

2D, Sprite packer, and PVRTC

Discussion in '2D' started by sameld, Dec 20, 2013.

  1. sameld

    sameld

    Joined:
    Dec 20, 2013
    Posts:
    1
    I wasn't able to find anything about this, so if there is something already regarding this please let me know.

    Normally, PVRTC compress sprites must be POT squares. However since we now have Unity 4.3 that will auto-create sprite sheets, is this still the case? In iOS mode, the sprite wont show up in the editor unless its square, but still gives the warning that it must be POT if its NPOT. Since the spritesheet will be POT, does that mean that, as long as its included in a sprite sheet, it will be fully compressed?

    Thanks for any clarification,
    -Brenden
     
  2. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    That is correct. Sprite sheets are tailored to the target platform and in case of iOS will be square POT and compressed (if you choose compression of course).
     
  3. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
    Ok. so if I understand, if I want to use compression I've to prepare squared sprite assets, right?
     
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    The whole texture has to be square, not necessarily the sprite. You can have multiple sprites on a square texture. The whole texture gets compressed not just the area that individual sprites cover.
     
  5. JMro

    JMro

    Joined:
    Sep 30, 2013
    Posts:
    6
    The dimensions of the sprites *should* be irrelevant since they are going to be placed into a square PoT atlas.

    However...

    There is an issue with the Mac 4.3 unity where it will not always import non square/PoT textures with pvrtc even if they are going into a square sprite sheet. I'm not sure if there is an issue logged yet, but there should be.

    An unfortunate workaround is to set non PoT textures to 16 bit in the short term.
     
  6. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
    I know this, but it's not working with sprite packer pro feature. If you try to create atlas with non-squared sprites and want to use PVRTC, you will be not able to use them as sprites and atlas will be not created!
     
    mog-mog-mog likes this.
  7. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
    Yes this is the issue! I'm on mac and I'm not able to use PVRTC on my sprites even I want to packe them to PoT atlas.
     
  8. JMro

    JMro

    Joined:
    Sep 30, 2013
    Posts:
    6
    You can try importing them when your platform is set to "Standalone" and then switch back to iOS after the import
     
  9. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
    You right, it's working this way. Thanks! I'm downloading unity 4.3.4 right now, maybe they fixed it, will see
     
  10. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
    Not really, still the same problem in 4.3.4f1 :/
     
  11. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    Hi,

    We're currently fixing the import pipeline. This issue should go away in the next Unity release (not 4.3.x).
     
  12. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
    Thanks Tomas, if its possible to say, what's the approx date of next release?
     
  13. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    approx 2014 :)
     
  14. Engidia_EduardBosch

    Engidia_EduardBosch

    Joined:
    Nov 14, 2013
    Posts:
    25
    Hi,

    I'm having the same Issue. I import the images in Android platform and everything works perfect. Then, when I switch to iPhone, the sprites that are NPOT and have PVRTC compression, becames corrupted and doesn't appear in my scenes. If I switch back to Android, everything works perfect again.

    Here is what happens if I switch from Android to iPhone. The sprite gets corrupted and my scenes doesn't find them to render on screen.
    $iPhone_NPOT_sprite.png

    I tried the solution from "JMro" but this does not work for me. Anyone knows a working method to mantain the sprite when i switch to iPhone having PVRTC compression?
     
    Last edited: Mar 5, 2014
  15. drfrankie

    drfrankie

    Joined:
    Aug 16, 2013
    Posts:
    1
    Ahaa...And add to it that, atlases don't have mip maps. So now i have big, uncompressed images that are also slow.
    Instead of adding shiny features to unity 5, that nobody uses, please fix these important everyday features ASAP, because I can't release my mobile game like that.
    I didn't pay for that!
     
    bluescrn likes this.
  16. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    @EduardBosch - this issue has been fixed and is included in the upcoming version 4.5.
    @drfrankie - we're working hard to add all the missing pieces developers discovered once 4.3 was released. Mipmapping is on the top of the list.
     
  17. Engidia_EduardBosch

    Engidia_EduardBosch

    Joined:
    Nov 14, 2013
    Posts:
    25
    Perfect @TomasJ.

    Do you know more or less when version 4.5 will be released? I've read that Unity is going to release 4.6 in Summer, but will have to wait a lot for 4.5?

    Thanks a lot,
     
  18. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963
    Any updates on this? Sprite Packer still produces non-POT atlases on Android and iOS platforms. No mipmaps too....
    Also, is there a way to manually set the compression type for atlases? You can only set it for textures, but they get transformed into atlases anyway...
     
  19. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    Atlases should be pot on iOS. If they are not, please submit a repro project.
    Mipmaps and compression type can be configured by writing your own packing logic.

    See docs:
    http://docs.unity3d.com/Manual/SpritePacker.html
    http://docs.unity3d.com/ScriptReference/Sprites.AtlasSettings.html

    See also:
    http://forum.unity3d.com/threads/unity-patch-releases.246198/#post-1678361