• Bugs
  • issue with multiple png files on unity

  • Editado
Related Discussions
...

So i have issue when i'm exporting the spine to unity. Since the images is a lot, resulting 1 single atlas with multiple png files. On unity for some reason, the skin functionality is broken, it's like it's not finding the other png( second and third png ), and cause the skin to be messed up. But if i have only 1 single png file, it work fine. May i know what is the solution for this?

I tried to make it so it only exported as 1 png file, but if i set the max width and height to more than 10000, the export stuck at 39%.

yes i'm using skeletongraphic, and yes i'm just aware about this multiple canvas renderer, and it work after i activate it. But the thing is, it said it cause some performance issue isn't it? It's better if it's 1 single png image isn't it?

And my images it's alot, because it consist of a lot of outfits, and when export it got 3 png image with 8000 max weight and height. I tried to make it as single page, with more than 8000 size, but it got stuck. Also when i google it also suggest me to use image folder instead of attachment, that also doesn't work, because the structure of the images already got subfolder. And say if i move it all into a single folder, will it actually work? Do you have any suggestion?

When exporting from Spine, you can export in multiple pages and repack the textures later at runtime. This is ideal when there are many costume differences and you need to change them. Please see this section for more information about runtime repacking:
spine-unity Runtime Documentation: Combining Skins

You can see a demonstration of skin combination and texture repacking in the example scene, Spine Examples/Other Examples/Mix and Match Skins.

this is something i have done, but it's not answering me with the fact that i have multiple png images exported, while avoiding using Advanced - Multiple CanvasRenderers for performance issue right?

Aside from your question: prefer power-of-two in atlas texture sizes, so e.g. 2048, 4096, 8192. Using 8000 or 4000 as max resolution is not something we would recommend, unless you have specific reasons for that.

mrd escribió

But the thing is, it said it cause some performance issue isn't it? It's better if it's 1 single png image isn't it?

Yes, having multiple atlas textures will produce additional draw calls, so having a single atlas texture would be preferrable in general. However, 8K is really large and having a single 8192x8192 texture might be problematic depending on your target hardware. Even if the hardware supports it, you should always perform measurements on the target device (using release builds) to see if a single texture is better or worse than having multiple smaller textures.

When having multiple atlas page textures, you can still improve the situation by having the draw order not switch between textures often, as described here:
spine-unity Runtime Documentation: Material Switching and Draw Calls

Aside from that, as the spine project is getting bigger with more images, right now i can't even export the result, it's getting stuck at 39% and nothing i can do about it. I have been waiting for hours.. Is there any solution for this?

If you are using Polygons packing, you can reduce the final exported texture size, but the export will take longer. Changing the Packing option to Rectangles may speed up the export.

There is also a Fast option to speed up packing. Packing will not be as efficient but will execute much faster.

Unchecking Limit memory may further increase processing speed, but if not enough memory is available, Spine may crash. So if the two mentioned above are enough to improve speed, it may be better not to do this.