leonardo.bilck The solution to having all textures in separate folders still have the following problems:
1) Shared attachments must be either duplicated per Skin (😢) or added to a separate folder. This will generate extra draw calls per skeleton, which will require multiple materials.
That's unfortunately a general theoretical tradeoff.
Your screenshot shows a very heavily alternating sequence of used atlas textures though. Please consider whether it's an option to rearrange your draw-order to have fewer switches between grouped shared attachments from one atlas page vs unique attachments from another.
leonardo.bilck 2) A solution to item #1 is repacking the texture in runtime after loading,
Yes, runtime repacking is the recommended solution if you can't re-arrange your draw order to have few atlas texture switches.
leonardo.bilck which does not work well for Addressables module (I tried it and it mess up the skin)
How did you perform runtime repacking with addressables?
Could you please share some reproduction steps and code so that we can understand what's going wrong?
Did you wait for the newly activated skin textures to be completely downloaded before repacking the skins? Coud you show the code how you are switching skins, waiting for the download and performing the repack operation?
leonardo.bilck I have a few questions about the Addressable module:
1) If all skin attachments are contained in a single separate directory, will only that skin be loaded from the Addressable?
I'm not quite sure I understand what you mean by that. You're still responsible for assigning the high-resolution textures to whatever Addressable packages and groups that you think fits your scenario. The Addressables module only performs downloading and replacement of low-resolution placeholder textures at active materials with the high resolution texture versions. Whenever a low-res placeholder texture is found, the high-res version is downloaded.
leonardo.bilck 2) What happens when we change skins? Will the unused skin be unloaded from memory?
Note that it's never about skins, but about textures. The AddressableTextureLoader
asset (suffix _Addressable
) Inspector provides a property "Unload After Seconds Unused". Did you try setting this property according to your needs? If you don't want automatic unloading, you can trigger the unload earlier whenever you need.
leonardo.bilck 3) What happens if multiple characters sharing the same skeleton use different Skins?
It's about textures. The textures of active skins are loaded in their high-res version via Addressables.