Author Topic: UIAtlas too large!!!!  (Read 10466 times)

taishsoft

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
UIAtlas too large!!!!
« on: April 12, 2012, 02:46:14 AM »
Hi,ArenMook
  First congratulations on your new site!
  Then I have the question which posted before,that is:how to reduce the atlas size.When I compress the atlas by using "RGBA Compressed PVRTC 4 bits",the effect in game is pretty bad,especially  atlas has the transparent sprite.And another question is it can't be compressed until it is square.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlas too large!!!!
« Reply #1 on: April 12, 2012, 02:53:55 AM »
Yup, PVRTC is limited to square textures, and it's also really, really bad as far as compression artifacts go. Unfortunately you are pretty limited here. Your best bet is to see what can be split up in your atlas into smaller, prefferably 9-sliced components. For example, take the following sprite:



It can easily be split up as it has one corner pattern, which can be one small sprite, and a repeating side pattern, which can be a tiled sprite. End result, this image can be reduced from 128x128 to a pair of 16x16 sprites.

With enough optimizations like that, it's possible to reduce large atlases down to a fraction of their size, letting you turn off PVRTC compression and maintain UI crispness.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlas too large!!!!
« Reply #2 on: April 12, 2012, 02:54:27 AM »
Oh yeah, and if all else fails, you can just create more than one atlas.

taishsoft

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UIAtlas too large!!!!
« Reply #3 on: April 12, 2012, 03:58:54 AM »
Thks very much!A atlas in 2048*2048 is 16Mb,you mean I turn off PVRTC and let it go?Oh my god,there are lots of atlas which size is 2048 or more in my game,and I try to use 9-sliced sprite in my game.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlas too large!!!!
« Reply #4 on: April 12, 2012, 04:22:00 AM »
2048x2048 is pretty big. I don't think I've ever had to exceed a pair of 1024x1024 atlases in the games I've developed by taking advantage of gradients, layered widgets and 9-slicing.

taishsoft

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UIAtlas too large!!!!
« Reply #5 on: April 12, 2012, 04:37:14 AM »
All atlas in your games are not be compressed?And when i compress a atlas which has a gradients and 9-slicing sprite,it looks ugly.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlas too large!!!!
« Reply #6 on: April 12, 2012, 04:44:19 AM »
Yeah, UI textures should never be compressed using PVRTC. It's not designed for that. It's only good for ... well, nothing really, but the artifacts are not that noticeable on regular in-game textures.

taishsoft

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UIAtlas too large!!!!
« Reply #7 on: April 12, 2012, 05:00:04 AM »
And do you have any suggestions in textures format.What my mean is that whether to compress the atlas not the source texture.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlas too large!!!!
« Reply #8 on: April 12, 2012, 01:39:59 PM »
I don't recommend compressing UI atlases, but if you are making a 2D UI you are free to uncheck the "generate mipmaps" option as you don't need them for 2D UIs.