tuhai993

hi, i'm new Spine, and i read about Texture Packing and want to use it, but i cant find full tutorial, i wonder that can i pack image from different Skeleton? and if it possible, the result will be 1 big image,1 atlast file and many Json file or something else? please if someone know about that point me the right way, thanks
tuhai993
Posts: 8

Erikari

Hello tuhai993,

So you said you read the documentation here: Texture Packing - Spine User Guide
As it says:
While it can be used for your Spine skeletons, it can also be run separately to pack all the images for your applications.
That's because what it does is taking all the images in a folder and pack them together. It outputs 1 or more png file and an atlas file that maps the position of all the images.

I think the guide is pretty comprehensive, you can pack what you need and then parse the atlas file in your preferred game engine to use those images. Skeleton files are not generated because the purpose of the utility is to pack textures, still, this is pretty useful because you can pack all of your game assets together.

If you don't need to have everything packed together but you just need a single atlas file you can simply generate it by exporting a json or skel file and select the option to generate an atlas, which is very similar to the options that texture packer provides.

You're right though, a tutorial would be great, I'll take note to make one (: thank you for the suggestion!
User avatar
Erikari

Erikari
Posts: 618

tuhai993

Hi Erikari, thanks for your rep
Erikari wrote:taking all the images in a folder and pack them together. It outputs 1 or more png file and an atlas file that maps the position of all the images.
i know this, but it's not all i want, now in my project i have many separate characters each have one small image, you now that mean when i use Unity it cost 1 draw call per Character, it's very waste. So i wanna find a way to pack all image(Unity support max size 2048x2048) as possible, i tried Texture Packing, it's oke, but in Unity it's generate a big texture that can split to many small image, but i cant use this small image like a texture to make a material for Skeleton Data. Sorry if i still not understand but you know, when we are not done something at least one time, we get confuse :(
Attachments
Spine.jpgtexture slice
tuhai993
Posts: 8

Pharan

Hello! It's not 100% clear what you're looking for so I'd like to try to confirm:

1. Do you have more than one skeleton? (more than one json?)
2. Do you want all those skeletons to share one texture/material so that they can be batched with one draw call?
3. Unity itself doesn't have a max size 2048x2048. Most modern mid-range platforms go 4096x4096 and up. Is 2048x2048 a limit you are imposing on yourself?
4. What are you trying to show that screenshot? That looks like Unity's Sprite system and it's not related to Spine-Unity.

If this is the case, what Erikari mentioned is the solution. If your images are too large and too many, it obviously won't fit in the 2048x2048 texture, so you need to increase the max size in the Spine Texture Packer. In Unity, you can increase the max size of your texture in the texture's inspector.
Unity_2017-08-09_22-23-14.png
User avatar
Pharan

Pharan
Posts: 4427

tuhai993

hi Pharan
Pharan wrote:1. Do you have more than one skeleton? (more than one json?)
Yes!
Pharan wrote:2. Do you want all those skeletons to share one texture/material so that they can be batched with one draw call?
exactly what i want.
Pharan wrote:3. Unity itself doesn't have a max size 2048x2048. Most modern mid-range platforms go 4096x4096 and up. Is 2048x2048 a limit you are imposing on yourself?
yeah it's support larger size but as i know 2048 is max size that Sprite Packer can work.
Pharan wrote:4. What are you trying to show that screenshot? That looks like Unity's Sprite system and it's not related to Spine-Unity.
that screenshot, i use Spine's Texture Packing. i just wanna show that when i pack them their skeleton cant find data
tuhai993
Posts: 8

Pharan

3. Spine's system is not related to Sprite Packer.
4. I'm not sure how Spine's Texture Packer can output that.
User avatar
Pharan

Pharan
Posts: 4427


Return to Unity