• Bugs
  • [Unity] Overlapping Skeletons flickering

Is there a reason why the new SkeletonComponent might cause multiple skeletons drawn on top of each other to flicker back and forth? (I think the flickering is in terms of draw order of whole skeletons. I guess whole meshes.)

Can anyone using the new double-buffered mesh SkeletonComponent confirm if this is a problem on your end as well?

(If one of the runtimes has a bug, should I post about the issue in the bugs section or the runtimes section? 😃 )

Related Discussions
...
  • تم التحرير

Post wherever you want, I use "view unread posts" so I don't actually care about the sections. The sections are for Shiu. :p

What version of Unity are you using? I don't see flickering. I see that 4.2.1 is complete broken (as was 4.2.0). Below are the exact same projects. Note in 4.2.1f the front skeleton's jaw draw order is wrong and also the back skeleton's tail shows up on top of the front skeleton's eye, but behind the front skeleton's jaw. That is not something I could cause with a bug in my code! Unity's submeshes and/or batching are completely FUBAR. |(

4.1.5

Image removed due to the lack of support for HTTPS. | Show Anyway

4.2.1f

Image removed due to the lack of support for HTTPS. | Show Anyway

😃

I notice it's not individual parts, just whole skeletons. I think it's a totally different issue from the messed up draw order of multi-material skeletons in 4.2.

I'll check out what's causing it sometime soon. But it's not something that you can see in a screenshot since it's individual frames look just fine. It's just that the order in which skeletons are drawn changes.
I'll email you a video in the meantime.

I don't see flickering with the goblin example, after duplicating the goblin and translating it slightly. Are you setting the Z for your gameobjects to control which is on top?

Not at all. Everything's at z = 0 and I don't make them move along the Z axis.

It's weird. I'm not seeing it with the goblins either.
I am using a perspective camera though, but that doesn't affect the goblins either.
I can't imagine what might be causing it. I'll look into it further.

Stuff I've found out so far:
(1) turning off the double-buffering (by commenting out the line that says usemesh1 != usemesh1😉 seems to make it go away.
(2) using an orthographic camera also makes it go away.
(3) Disabling my camera's follow script (which makes the camera move a lot) doesn't fix it.

You should probably use Z to control what is drawn on top of what.

Bad news: setting the Z (apart from involving a bit of extra management if it did work) doesn't fix it unless I give it rather large differences in Z, which makes the sprites look really messed up and obviously misaligned with a perspective camera. It's kinda weird that it would do that. Regardless, having 5 to 15 spine skeletons will immediately look ridiculous if I give all of them unique, disparate Z values.

Anyway, there might be a better solution somehow. It doesn't happen with the goblins after all. I need to find out why.
This isn't a huge issue for now so I won't investigate it too thoroughly. But I'll be sure to let you know if something comes up. I'll just turn off double-buffering in the meantime.

The mysteries of using a closed source runtime. 🙁

Indeed.

Anyway, good news. I asked my friend if he had any hunches. There's one Unity camera setting called transparency sort mode (only accessible through code so I had no idea it existed), and setting it to orthographic fixed it. First time I've ever used it, but it makes sense to use whenever you'd use Spine anyway, so I'm calling it a non-hackish solution.

What didn't make an awful lot of sense was why it was flickering in the first place. If I had to guess, it was some sort of crazy floating point math inaccuracy from when Unity calculates the distances between the 3D positions of camera and the centers of the meshes... and then some other crazy stuff.

Heh, well that is good news at least. And it is forever immortalized here in the forums for the next guy searching for Unity flickering. 😃