Hello Guest

Author Topic: Non power of two atlas  (Read 4537 times)

DannyB

  • 2D Toolkit
  • Hero Member
  • *
  • Posts: 609
    • View Profile
    • Chicks Ahead
Non power of two atlas
« on: November 13, 2012, 07:42:29 pm »
Hello,

I understand that square shaped, power of two textures are only required on iOS when you are using compression.

If this understanding is correct - shouldn't there be a way for me to tell tk2d that I am not going to need compression, and therefore the generated atlas0.png should not have any extra padding? Won't that save some space?




unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Non power of two atlas
« Reply #1 on: November 13, 2012, 09:42:29 pm »
Is this for fonts? This was never enabled in older versions as they used mipmaps. You can only have non po-2 textures when not using mipmaps. I could add an override I suppose, but would it really save that much for normal sprite collections? I can understand it'll save a ton for backgrounds, but you have much better options for backgrounds, use resources.Load, and use tk2dSprite.CreateFromTexture(...) directly from the texture itself.

DannyB

  • 2D Toolkit
  • Hero Member
  • *
  • Posts: 609
    • View Profile
    • Chicks Ahead
Re: Non power of two atlas
« Reply #2 on: November 13, 2012, 09:51:46 pm »
Well, I was not talking about fonts, no.

Most of my atlases have over 30% wastage.
I am sure I can organize them better, but I always like to keep the atlases logically organized as well, so I am not mixing elements in one atlas just because I have space available.

I am never using mipmapping, as it is my understanding that for 2D, pixel perfect, I dont need any.

If indeed a smaller PNG means it takes less space in the final build, then I suspect most of my atlas.png files will enjoy 20-30% reduction in size, which is quite a lot.

Of course, if I am wrong in my assumptions, or the addition of such feature will bloat the plugin, then lets skip it, but if I am right, I would love to enjoy this reduced size.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Non power of two atlas
« Reply #3 on: November 13, 2012, 10:34:27 pm »
Dunno why I typed fonts, I meant backgrounds.

If you've got 30% wastage, I can give you a patch where you can type in an override resolution. The one which is released limits to PO2 resolutions, but easily changed to support non PO2. Its only worth doing this as a last minute optimization though.

DannyB

  • 2D Toolkit
  • Hero Member
  • *
  • Posts: 609
    • View Profile
    • Chicks Ahead
Re: Non power of two atlas
« Reply #4 on: November 14, 2012, 06:13:37 am »
Ok thanks, so I will avoid for now. I want to stay with the "mainstream" release.