Hello Guest

Author Topic: Unable to fit in Atlas  (Read 6158 times)

artician

  • Newbie
  • *
  • Posts: 20
    • View Profile
Unable to fit in Atlas
« on: August 17, 2014, 01:24:09 am »
Hi,

I'm getting a frustrating error.  I am updating existing sprites with new versions of the artwork. 
In our first-pass test implementation we had 18 frames that were 1080x1080 resolution. 
Since that worked, we finalized the artwork, which resulted in sprites that used a lower resolution (1024x1024), and less frames (17 instead of 18).
Filenames are all the same.  We deleted frame 18 from the original sprite collection, and overwrote sprites 1-17 with the finished versions.
The problem then appears in a dialog that states:

"Unable to fit in atlas
You have a texture which exceeds the atlas size.
Consider putting it in a separate atlas, enabling dicing, or reducing the texture size."

Can you please help us solve this issue?  It makes no sense considering the sprites use 1 less frame, and are a lower resolution than the original.  Using the original sprites we have a working build on the target platform.

Thank you for any assistance.

artician

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Unable to fit in Atlas
« Reply #1 on: August 17, 2014, 02:40:00 pm »
More info:
Running Win7.
Unity ver. 4.3.4.
2Dtk ver. 2.3.0

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Unable to fit in Atlas
« Reply #2 on: August 17, 2014, 11:13:49 pm »
2D Toolkit trims and crops your sprites before atlasing them. If you have changed the contents of your atlas, the likelihood is the packing will change. The number of frames doesn't really factor into this, you can have 1000s of nearly empty sprites in a collection, what really matters here is the amount of data to pack. Try the dicing feature to help pack a bit more into your atlas - this usually works best for static sprites that don't animate - moving them is fine, just not using tk2d animations.

artician

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Unable to fit in Atlas
« Reply #3 on: August 18, 2014, 12:12:22 am »
All of the sprites in my sprite collections animate, and just to clarify again: the resolution on these is lower than what was there before.  Any suggestions?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Unable to fit in Atlas
« Reply #4 on: August 18, 2014, 01:24:36 am »
Has the amount of transparency changed? Tk2d considers that when packing the atlas.

artician

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Unable to fit in Atlas
« Reply #5 on: August 18, 2014, 08:00:49 am »
Yes, definitely.  The art in question now has a glow effect, which would probably increase the size of each sprite.  :(

So that may be it.  I've tried packing the sprites into their own atlas, but it throws the same error.  Is there any way to overcome this without altering the art itself?  How inefficient is it to have multiple sprite collections for one animation clip?

Thanks for your help.


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Unable to fit in Atlas
« Reply #6 on: August 18, 2014, 08:59:37 am »
That is probably it. It looks like your images are considerably larger now? If you're packing these into their own atlas, turn off padding and it should fit. Multiple sprite collections per clip isn't too bad, but can affect batching if you have loads of the same sprite in view simultaneously.

What do your images look like? If you have only a few animated sprites and can benefit from dicing, that could be a good option.