Nate लिखाA dynamic texture atlas could be most efficient if it isn't feasible to pack images in such a way that draw calls are minimized. I don't have experience building an atlas at runtime with Unity though. FWIW, with libgdx you'd use PixmapPacker.
The problem I have is not draw calls, but the amount of memory required for all of the atlases if I'm to have all of the wardrobes loaded at once. Then it would be 8.5x 2048x2048 texture atlases! They are going to be optimized a little bit more, but I don't think we can get under 7x2048x2048 atlases for all of the wardrobes. Then on top of that we have the base body images for the characters and other GUI stuff and backgrounds etc.
Nate लिखाYou can control which textures are loaded and can even load them lazily by using your own AttachmentLoader. This is also how you'd use individual images instead of an atlas, if you wanted.
This sounds very interesting and is probably the best way to do it if I am thinking correctly about how it might work ;-)
I'm guessing I can hook into some sort of callback whenever an attachment's image is needed? Then I could either just hand off individual images or I could conceivably then have a blank 2048x2048 texture atlas that I add the individual images to 1 by 1.
Handing off individual images would be the easiest but I don't know how to do that or if it would work?
I'll look into the AttachmentLoader then and see if I can figure it out.
Nate लिखाHow many images will you have attached at once?
I will have 1 image for each attachment for a total of 8 images at once, on top of the base skin.
Nate लिखाHow many skeletons on screen at once?
Only 1 skeleton on the dressing screen.
Nate लिखाWhat platforms are you targeting?
Mobile platforms only, starting with iOS and Android.
Nate लिखाIf texture binds aren't a bottleneck, you could get by with packing images you expect to be drawn together as best you can and just have multiple binds.
I don't know what texture binds are? I guess it means how many textures are loaded at once? In that case it would be too many with 8x2048x2048.
Pharan लिखाI was also thinking about how Spine might be able to take advantage of Unity 4.3+'s built-in sprite packer. There are hints of theoretically being able to in their scripting docs.
But it's currently in beta and I think the APIs aren't solid yet. And currently, some access to it needs Unity Pro so I haven't been able to try it at all.
It would be great if you could choose how the packing should be done from Spine for output to Unity. Just being able to tag things in the tree according to which atlas you want it added to or something like that? An easier workflow for noobs like me would be good ;-)
Thanks for helping me learn this stuff guys!