Hello Guest

Author Topic: Creating atlas which is not to the power of 2  (Read 3874 times)

ivomarel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Creating atlas which is not to the power of 2
« on: July 04, 2013, 10:53:53 am »
Hey all,

Simple question and hopefully a simple solution. When I create a sprite collection it will always save as an image to the power of 2. Not sure why, but I am wasting some space here since I have some very small atlases (I found that in some cases saving images separately will increase performance).

Who can tell me how I can save the sprite collection to not be to the power of 2?

Cheers,

Ivo

ivomarel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Creating atlas which is not to the power of 2
« Reply #1 on: July 04, 2013, 11:49:02 am »
Found this site - http://www.cocos2d-iphone.org/forums/topic/better-to-use-power-of-2-and-scale/

So if I use an image of 300*300 pixels, it takes as much memory as an image of 512*512... A reason to use bigger atlases, but in my case I will just resize my buildings to close to 256*256 pixels.

That's why. Good to know ;)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Creating atlas which is not to the power of 2
« Reply #2 on: July 04, 2013, 11:52:42 am »
A NPOT 300x300 uncompressed without mipmaps will take less memory than 512x512 on some graphics chipsets. Sadly exactly what each gfx chip does depends very much on the chipset, and there often isn't very much documentation about specifics...

ivomarel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Creating atlas which is not to the power of 2
« Reply #3 on: July 06, 2013, 03:00:31 am »
Thanks for the reply!

So than what's the reason that I can't create an atlas which is not to the power of 2?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Creating atlas which is not to the power of 2
« Reply #4 on: July 06, 2013, 11:48:22 am »
Its not an option, simply to avoid confusion and issues on different platforms. There are incompatibilities with NPOT with mipmaps on certain hardware, but not on others. Different hardware does different things and requires different layouts in memory.

You have the source to 2D Toolkit, if you want to add the option in its pretty simple. (tk2dSpriteCollectionEditorSettingsView, look for allowedAtlasSizes).