Cool.
If you're just using Spine/Skeleton
, I have no idea why you're having these sorting problems. This is definitely the first time I've seen it happen.
But in any case, z-spacing should have no effect on Spine/Skeleton. You can read the shader code yourself, it doesn't use depth info.
You can send it to unity@esotericsoftware.com.
If you're sending a zip of the project folder, make sure to not include the Library
folder. It's not needed for sharing.
09 May 2017 6:42 am
You forgot to mention you had more than one texture/material. 🙂
This is generally bad news.
Each material means a separate submesh and a separate draw call.
And you get weird sorting SOMETIMES, which is really weird. I'm not too sure of what rules Unity uses myself (I mean sorting between submeshes).
But I do know that this setup (if you have multiple instances of the same skeleton) will cause strange overlaps between instances.
I know at these higher resolutions, you might not have a choice. But it's generally better to pack your whole character's parts into one texture.
max 4096x4096 should be fine for most modern targets. High-resolution targets should support that sort of texture size. And you can pack a smaller one for older devices.
Beyond that, the best we can do is blindly obey Unity's internal submesh sorting and give it the z-spacing it wants.