- Modificato
Submeshes render in random order with orthographic camera
Submeshes render in random order with orthographic camera (It have Transparent materials, ordering by Z and other things for correct render order)
Steps to reproduce:
1) Open Assets/BugScene scene in Unity 5.6.0f3 (or 5.6.1f1)
2) Look at jaws of dragons
And it worked correctly in previous Unity version (for example 5.5).
Unity bug report: https://fogbugz.unity3d.com/default.asp?910858_0diqjnj67814hj3i
Is this Unity?
We'll be moving this topic to the Unity section.
Anyway, other users seem to have reported the same. (Sorting Error on Start)
Do read that thread and the problems with having too many submeshes in case that is your situation.
Thanks for reporting this to Unity!
If you're on Unity 5.6, try adding a Sorting Group component to your Spine GameObject.
It suspiciously looks like the problem is also caused by Unity trying to be helpful by batching submeshes on different meshes. But it's doing it in a way that wrecks the order within specific meshes. Adding the Sorting Group component seems to fix things.
Pharan ha scrittoIs this Unity? We'll be moving this topic to the Unity section.
Of course! Sorry for my mistake.
Pharan ha scrittoIf you're on Unity 5.6, try adding a Sorting Group component to your Spine GameObject.
Amazing! With Sorting Group it works correctly! Thank you!
But unfortunately this "hack" disable batching and forcing render meshes one-by-one. (in previous Unity version like 5.5 batching can work and save submesh order).
P.S.
If disable batching manually (from material for example) then Unity render submeshes randomly whatever (with orthographic camera only, perspective camera works well)
It's ok. We still read these. Just want to make sure other readers/forum users understand what the topic is about and can find what they need.
Yeah, unfortunately, this is the cost of it until Unity fixes the problem, if they consider it a problem at all.
But batching (and sorting) was ruined the moment your mesh had more than one submesh, really. So the Sorting Group is pretty harmless in that particular case.
Also notice how when your characters with multiple submeshes overlap each other, their parts also are also sandwiched. That's usually not what people want for separate skeletons.
Depending on your situation, you ideally either want to use runtime repacking (if multiple materials was because of equips), or making sure your Spine export only outputs one atlas page/image.