Hello Guest

Author Topic: PNG Atlas vs Not-PNG Atlas?  (Read 5577 times)

David Kalina

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 26
    • View Profile
PNG Atlas vs Not-PNG Atlas?
« on: January 31, 2014, 12:09:33 am »
What exactly is the difference between a "PNG Atlas" and the format of texture atlases in the past?

We just noticed that our build size is ballooning like mad (oh hi 700MB for 1/6 of the final game), and it appears that texture atlases are entirely uncompressed....?  They still show up as PNGs (atlas0.png) so I'm a bit confused as to why these would be uncompressed...  like, isn't the point of a PNG that it is a lossless compression format? 

It sounds like "PNG Atlases" are the solution here, I'm just curious what the actual feature is since there doesn't seem to be any detail on it in the docs.

Thanks,
David

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: PNG Atlas vs Not-PNG Atlas?
« Reply #1 on: January 31, 2014, 11:18:05 am »
When normal PNGs are imported into Unity, they get converted into its own format, which isn't compressed. This ends up adding significant disk overhead. The PNG atlas option works around that and keeps the textures as PNGs even when the project is built.

eezSZ

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: PNG Atlas vs Not-PNG Atlas?
« Reply #2 on: February 17, 2014, 04:30:26 pm »
Why wouldn't Unity do this already?  Is there a loading or performance overhead?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: PNG Atlas vs Not-PNG Atlas?
« Reply #3 on: February 17, 2014, 04:48:59 pm »
Quote
Why wouldn't Unity do this already?
No idea, probably because their pipeline is already built in this way.

Yes theres a loading overhead, but should be minimal in the grand scheme of things.

kurayami88

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: PNG Atlas vs Not-PNG Atlas?
« Reply #4 on: February 18, 2014, 01:57:22 pm »
I believe I read this somewhere...

its a question whether you prefer size vs performance.

the unity texture is the fastest as it can directly use the image... but since it's ready to go at any time, obviously it needs to be store somewhere so it takes a lot of space...

on the other hand, PNG atlas are small... but the engine will then need to convert the PNG into their usable format during runtime. This in turn takes processing power... how much processing power? i do not know exactly...

so.... which do you like?

David Kalina

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: PNG Atlas vs Not-PNG Atlas?
« Reply #5 on: February 19, 2014, 06:57:00 pm »
Personally, I like having the choice!  Which is why the PNG Atlas tool is so critical, in spite of its rough edges -- because Unity currently doesn't let the developer choose easily, and instead always opts for speed over package size.  Which is great on PC... but on mobile, it's almost always the wrong choice.

I made a post on the Unity Feedback system endorsing a native implementation of such a feature:

http://feedback.unity3d.com/suggestions/png-and-jpg-texture-format

Please go vote on this issue!

Using PNG Atlases brought our package down from 800MB to under 200MB...  we're going to release a big game for mobile no matter what, but it can't be in the GB range.  But it should be even smaller -- a number of our textures, including stuff we aren't using 2DToolkit for, or stuff we're using in conjunction with the Spine animation system can't be easily compressed. 

Native Unity support for PNGs is the best long-term solution and people should feel free to make some noise about it :)