Hi,
we've been using spine for our project for some time now, but yesterday we added a new animated character to a scene that suddenly started lagging.
I put the skeletonanimation in a new scene to do some profiling, in order to make sure nothing else was interfering. As it turns out, the Skeleton.LateUpdate takes up 18ms
The model itself does have over 3k verts, which is not exactly light, but it's not much more than our hero character which only costs 1.8ms in LateUpdate. Surely there's something else that's making it cost 10 times more.
The model itself doesn't have that many constraints either.
Edit: I just noticed that the CPU cost is not dependent on the animation that is played. Even if the animation is set to "None" the CPU cost is identical. I just did a profiling for all other spine assets in my project and there's only 2 of them that have this issue, both of which have some animations which use a mask.
Here is what it looks like in Unity in wireframe
I tried to enable all the optimisations in "advanced" rendering options. That allows me to gain 2ms but that's still 16ms, way too much.
My only hunch is that it may have to do with the fact that we're using a mask, but I can't see it being a good justification for such a high CPU cost.
What steps can I take to more precisely profile where the CPU cost comes from?
Well, as it turns out, the problem is indeed the masks. I can solve some of this by using a sprite mask in unity and a renderer separator. For the rest, I'll see with my animator how she can better optimize the masked meshes so as to reduce the performance impact.