Hello Guest

Author Topic: Problems with atlasing long, narrow images (2.1)  (Read 3967 times)

JFBillingsley

  • Newbie
  • *
  • Posts: 18
    • View Profile
Problems with atlasing long, narrow images (2.1)
« on: September 04, 2013, 05:13:58 am »
I've got an animation that consists of 17 very skinny images (1440x144). Since it's going to be part of an animation, I don't want to dice them as I hear that does horrible things to performance. The problem is that they really should all fit in a 2Kx2K atlas, but.... well:



TK2D wtf r u doin

All these images would fit with plenty of room to spare if it stacked them up like pancakes, but for some reason the packing algorithm wants to turn them at strange angles and waste space, and then it whines that it can't fit everything.

Is there some way to "coerce" the algorithm into doing the proper thing?

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Problems with atlasing long, narrow images (2.1)
« Reply #1 on: September 04, 2013, 10:06:33 am »
Hi,

I tried this myself by creating 17 images of 1440 x 144 and packing them into a 2048 x 2048 atlas and you can see the results attached.  As you can see for those images it worked.  I'm guessing for your images although they are 1440 x 144, some of them have a lot of transparent areas which will be stripped making the images different sizes and is affecting the algorithm (yes, the algorithm isn't perfect...).  In the SpriteCollection window in settings, try checking the 'Disable Trimming' box to see if that fixes the problem.
« Last Edit: September 04, 2013, 10:19:09 am by gary-unikronsoftware »

JFBillingsley

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Problems with atlasing long, narrow images (2.1)
« Reply #2 on: September 04, 2013, 10:40:40 am »
You're right about there being several images with large transparent areas.

I was curious and tried throwing a bunch more textures into the collection, and now it packs them all into a 2K atlas. Still looks really really weird, but hey.