• Editor
  • Polygon packing

  • 已编辑

I tried to export using polygon packing to compress atlas for Unity projects.
I tested it with 3 images in a 512x512 PSD:

In Spine, I made meshes for every image trying to not get a bigger mesh than the image itself would be:

Here my export settings:

But it doesn't seem to work very well when exported:

I think polygon packing doesn't compress the best way.
Let me know if I'm doing something wrong.

Thanks!

Edit: I'm using v4.2.40

Related Discussions
...

I must export it with "Square" and "Power of Two" for a better compression in Unity.
The meshes are tight enough in my opinion.
I think it's the way of packing the atlas. Forces the images to be on edges and this is what avoids to get the placement I made on Photoshop.

Polygon packing doesn't try all rotations of your images. It tries rotating by 90 degrees to find which packs best. It may be better to draw your blue line straight.

Packing is "NP hard" meaning it can only give a "best effort" solution. While you can pack the 3 images manually, the texture packer may not be able to.

Typically there are many images, so even if a few aren't packed as you would do it manually, it still packs well.

    Nate
    Thanks for your reply, Nate!

    I didn't know polygon packing only tries rotating by 90 degrees. I usually try to draw straight lines, but I wanted to try this.

    Thanks again! Have a nice day 🙂

    You're welcome! 👍

    If polygon packing rotated images at angles other than 0, 90, 180, and 270 then the region image pixels wouldn't match up to the pixel grid of the texture atlas page image. It would need to do filtering to write the region image, and that would add some blurriness, just like if you manually rotated the image.