Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: beermoney on July 24, 2014, 05:01:08 AM

Title: atlas and iOS texture compression
Post by: beermoney on July 24, 2014, 05:01:08 AM
Hi, I'm finding that enabling texture compression on iOS is corrupting my atlas. I know that true color texture is preferable for quality but I need reduce the size of my assets :/  I have an atlas that when created is 2048x1024, I set it to compressed and this changes the texture to 2048x2048 which corrupts the atlas UV/pixel coords.  I'm thinking of adding a single texture of 1x1025 to force the atlas to be created at 2048x2048, is there a better solution to this problem?

many thanks
Title: Re: atlas and iOS texture compression
Post by: Agent_007 on July 24, 2014, 06:19:01 AM
As you suggested, adding long lines is the easiest solution to make atlas maker to always output square textures.
Title: Re: atlas and iOS texture compression
Post by: ryan on July 24, 2014, 01:14:21 PM
I thought the easiest way was to check the "Force Square" box in the atlas maker.  (It only shows up if "Unity Packer" is unchecked.)

If file size is what you're worried about, you can include the atlas in your build as a raw PNG instead of as an imported texture. (http://www.tasharen.com/forum/index.php?topic=9891.msg46484#msg46484)  The down side to this is that it uses up just as much memory as an uncompressed texture, so if memory use is what you're worried about, this won't help.
Title: Re: atlas and iOS texture compression
Post by: Wisteso on July 24, 2014, 03:40:04 PM
Ryan is correct, you would force it to use a square texture using the alternative texture packer. (I use it, it works better than the default IMO)

iOS texture compression does not work unless width=height and dimensions are 2^X.

I dont recommend texture compression though if you have any transparency going on in the UI. PVRTC sucks with transparency. You could perhaps dither to 16-bit color though and reduce texture use by 50% in theory.
Title: Re: atlas and iOS texture compression
Post by: ArenMook on July 25, 2014, 02:23:45 AM
PVRTC sucks, period, not just for transparency. It's somewhat passable for texturing 3D objects on a low-res device, but that's it. Its artifacts are extremely noticeable, and would just kill the look of your UI. For UI I would suggest just sticking with the truecolor option, and finding ways of reducing the size of your sprites instead. Using sliced sprites and making your UI elements modular (made up of several different smaller components) can greatly reduce the size of your atlas.
Title: Re: atlas and iOS texture compression
Post by: beermoney on July 25, 2014, 06:03:14 AM
thanks for all the useful advice!