Author Topic: Atlas Texture Compression  (Read 3591 times)

hvilela

  • Guest
Atlas Texture Compression
« on: October 30, 2012, 12:43:19 PM »
I've create an atlas with NGUI's Atlas Maker, the result is an 2048x1024 automatic truecolor 8M image. So far so good.
As long it's taking too much from my memory, and as long it's just pictures (no text or anything that has to be pixel perfect) I decided to compress it.
When I do, it becomes an 2048x2048 image and saves me 6M, great.

The problem is that at this point, all the atlas coordinates are wrong.

What can I do to fix it keeping my texture compressed?

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: Atlas Texture Compression
« Reply #1 on: October 30, 2012, 12:54:20 PM »
I think you're misusing Unity a bit based on your description.
Unless you REALLY need all of these images to batch or need them to display at the same time, I would recommend just putting these images separately into the Resources folder and do a Resources.Load at runtime to apply them to a material. Then use the UITexture component to display that in NGUI if needed.

The other option is that you might just want to add some images to the 2048x1024 atlas so that it will pop to a 2048x2048. It won't cost you anything as the compressed image will still be the same. However, if you don't need batching, I think that the UITexture option is going to work best and save the most RAM.

hvilela

  • Guest
Re: Atlas Texture Compression
« Reply #2 on: October 30, 2012, 01:02:58 PM »
It's a bunch of small images to be displayed at same time, or at least in the same screen using an UIDraggablePanel. With Resource.Load they will use much more memory and will require much more draw calls.

I think I'm going with the extra images workaround. Thank you!

PhilipC

  • Guest
Re: Atlas Texture Compression
« Reply #3 on: October 30, 2012, 01:43:21 PM »
You could also change the UITexturePacker if you wish. Line 88 is where is will increase the width or the height to the next power of two. If you make is such it always increase both you will maintain the POT which will compress fine.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas Texture Compression
« Reply #4 on: October 30, 2012, 04:54:35 PM »
Never use compression with UI textures. Texture compression, especially PVRTC is meant for textures on 3D models, never for the UI.