I know that I can repacking an atlas with different skins, but can I make 1 atlas for 2 different skeletons in Runtime?
Runtime Repacking with 2 Skeleton
- Modifié
Yes, there is nothing preventing you from e.g. adding regions from different original atlases or even Sprites to e.g. a Skin bothCombined
skin. Every Attachment can reference it's own texture.
You can have a look at these postings for reference code on how to combine and re-pack skins:
Question about proper way to handle mix and match
Mix and Match with Skins
I don't think I was clear. I have 2 different characters in 2 different spine objects, can I repack both in the same atlas?
The first of the two urls that I posted deals exactly with this case.
Ok, I made it to work, but now I have two problems.
First, if the images are compressed via unity inspector, when I repack the images become white squares, depending on the compress format other weird things happens.
Second, some of the texture compression using in the repack atlas like DTX5crunched makes the Unity crash.
If I don't make the textures crompressed before, the game build size will drastically increase.
General Unity limitations apply here:
MichelVictor a écritFirst, if the images are compressed via unity inspector, when I repack the images become white squares, depending on the compress format other weird things happens.
Reading from compressed textures is in general not supported in Unity (at least this applies to the majority of Unity versions and formats), I wonder that it even did perform anything at all and not throw an exception.
Second, some of the texture compression using in the repack atlas like DTX5crunched makes the Unity crash.
What exactly did you do that made it crash? Do you mean you tried to re-pack from a compressed texture?
If yes: this is expected as described above.
If no: do you mean you compressedthe re-packed texture and it crashed there?
If I don't make the textures crompressed before, the game build size will drastically increase.
Depending on the target platforms, the available texture compression formats produce artifacts quite unsuitable for sprite art with sudden changes in opacity and color (e.g. black outlines or anything close to vector-art). Chances are that if you don't find the compression artifacts ugly on your art already (for which it is rather unsuitable), that you can then cut resolution in half, saving the same storage space amount.
If this is not an option and you really need all textures compressed, I'm afraid you will need to use atlases packed at build-time.
If no: do you mean you compressedthe re-packed texture and it crashed there?
Exactly I make a repack and use a compression method in the same line, some of the compressions crashes the Unity. DTX5crunched is one of them.
But anyway I'll think what approach I'll follow since I have some limitations.
MichelVictor a écritExactly I make a repack and use a compression method in the same line, some of the compressions crashes the Unity. DTX5crunched is one of them.
Does this happen at runtime on the target device as well? Or does it "only" crash the Unity editor? I assume the repacked texture width and height are multiples of 4.
In editor, I didn't tried in a device. I didn't especific any resolution so I presume it is in the right aspect ratio. It only crashes in some of the compressions type list.
MichelVictor a écritIt only crashes in some of the compressions type list.
How could you specify a compression format anyway? Just asking since the runtime method Texture2D.Compress offers no specific format. Or are you using EditorUtility.CompressTexture
? If you are using the editor method, I wonder why you are programmatically recombining atlas parts to new textures before the build and not set them up as desired in the first place.
MichelVictor a écritI didn't especific any resolution so I presume it is in the right aspect ratio.
It is not the aspect ratio that matters here, both width and height have to be multiples of 4. Ratio of width to height does not matter here.