• Unity
  • Runtime Repacking when there are 2 source materials

  • Modificato
Related Discussions
...

So I've been diving into the repacking feature for equipping parts on your avatar.. more or less following the Runtime Repacking method here - http://esotericsoftware.com/spine-unity-mix-and-match

This seems to work ok, however I have a question related to our setup. The artists have given us a rig that has so many attachment slots that they can't fit into 1 material. E.g. we have a spine skeleton whose Atlas asset has two pages (& two materials)... At runtime, I've managed to parse through the atlas to find the right source material for repacking and can equip parts, BUT:

It seems like the API for repacking doesn't support ending up with multiple materials...is that correct? Consider the example where I end up equipping so much gear that it can't fit on to the repacked texture. Then what? lol

It rides on the Unity texture packing API, which I think only has the capability of outputting one texture.
Beyond that, I'm not sure.

Are you saying you can't just fit it in a larger texture? Like 4096x4096? That's an optional parameter on the repack method. maxAtlasSize.

well, our avatar spine is coming at one 4096x4096 texture and one 2048x2048 texture for the leftovers. should they be this big? I don't know.

I realized I can pass GetRepackedSkin the output material...perhaps I should just have multiple output materials that I pass to this function? depending on which atlas page it's on? I'm not so sure that will work as it ultimately just loops through & repacks all the attachments on the skin (I think).

it seems like the system is close to supporting multiple Runtime materials if it isn't already, right? like as it's looping through the attachments, it probably just needs to make sure it's only grabbing attachments for the current atlas page?