Author Topic: atlas and iOS texture compression  (Read 3799 times)

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
atlas and iOS texture compression
« 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

Agent_007

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 5
  • Posts: 27
    • View Profile
Re: atlas and iOS texture compression
« Reply #1 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.

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
Re: atlas and iOS texture compression
« Reply #2 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.  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.

Wisteso

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 3
  • Posts: 103
    • View Profile
Re: atlas and iOS texture compression
« Reply #3 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: atlas and iOS texture compression
« Reply #4 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.

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: atlas and iOS texture compression
« Reply #5 on: July 25, 2014, 06:03:14 AM »
thanks for all the useful advice!