Kanbaru

Spine runtime library version: 3.6
Unity editor version: 2017.4.0f1(x64)
Issue: Spine animation rendering order incorrect.

I have set the order of multiple pictures in spine,
In Unity, I only use one Skeleton Animation component to render it.

捕获.PNG


GIF.gif


But when I render multiple identical objects or different objects at the same time, rendering errors occur.

GIF3.gif


Even our boss animation has this problem too.

---

GIF5.gif

GIF6.gif
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Kanbaru
  • Сообщения: 2

Pharan

This is a known bug with Unity when your MeshRenderer has more than one material. Sorting breaks when it tries its best to batch materials.
It's been several versions and they still haven't fixed this.

But you have two options as a workaround:
Option a. Make sure your skeleton uses only one texture and material.
Option b. Add a Sorting Group component to each Spine GameObject.
Аватара пользователя
Pharan
  • Сообщения: 5366

Kanbaru

Thank you :)
I added the Sort Group component, it works!
Kanbaru
  • Сообщения: 2

IndieDoroid

Pharan писал(а):This is a known bug with Unity when your MeshRenderer has more than one material. Sorting breaks when it tries its best to batch materials.
It's been several versions and they still haven't fixed this.

But you have two options as a workaround:
Option a. Make sure your skeleton uses only one texture and material.
Option b. Add a Sorting Group component to each Spine GameObject.
I did not know about sorting groups! Very awesome. Thanks @Pharan!
Аватара пользователя
IndieDoroid
  • Сообщения: 119

Bladdock

Can anyone explain in a bit more detail how Option b should be carried out? I believe I'm facing the issue described here and I've endeavoured to fix it by using Sorting Groups on all the Spine game objects in my scene. Each object has a distinct order in layer value in its Sorting Group component. And still, in Unity's scene view, I get flickering skeletons when I moved the camera around. Thanks for everyone's help in the thread so far, from what I've seen of these forums so far this a very helpful community.
Bladdock
  • Сообщения: 6

badlogic

Are you using LWRP? We have a bug open that sounds like the flicker you experience.
Аватара пользователя
badlogic

Mario
  • Сообщения: 2127

Bladdock

We are using LWRP, yes. I'll try seeing if I can switch to the standard render pipeline and see if anything shakes out. Thanks.

EDIT:

Yeah that seems to stop the flickering. Some more details in case it helps you guys fix the bug:
  • The flickering did not occur in the Editor's Game View while in Play Mode.
  • The draw order did have an issue in Android builds (and perhaps other builds, untested), but it wouldn't flicker, it would stay statically drawn in the wrong order. This has also been switched by ditching LWRP.


---

Is there any expectation of when this bug will be resolved? Thanks.
Bladdock
  • Сообщения: 6

Harald

Sorry for the trouble and thanks for the info! This bugfix is scheduled with high priority and will be fixed in the next few days.
Аватара пользователя
Harald

Harri
  • Сообщения: 1116

Bladdock

Excellent, thanks. Is there somewhere I can subscribe to updates on its status so that I don't have to keep pestering you here? :)
Bladdock
  • Сообщения: 6

badlogic

Аватара пользователя
badlogic

Mario
  • Сообщения: 2127

Harald

This issue has been fixed (via a Fix Draw Order parameter that can now be enabled) and new unitypackages are available for download.
Now providing additional Fix Draw Order parameter at SkeletonRenderer, defaults to disabled (previous behaviour). See spine-unity Runtime Documentation: Setting Advanced Parameters.

Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A").
If true, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes by e.g. the LWRP renderer, leading to incorrect draw order (e.g. "A1 B A2" changed to "A1A2 B"). You can leave this parameter disabled when everything is drawn correctly to save the additional performance cost.
Thanks for reporting!
Аватара пользователя
Harald

Harri
  • Сообщения: 1116

Bladdock

Excellent, thanks a bunch guys. I've never had a support issue go so smoothly :)
Bladdock
  • Сообщения: 6

Harald

Thanks for the kind words, glad it could be resolved rather quickly. :)
Аватара пользователя
Harald

Harri
  • Сообщения: 1116

leonardo.bilck

Harald писал(а):This issue has been fixed (via a Fix Draw Order parameter that can now be enabled) and new unitypackages are available for download.
Now providing additional Fix Draw Order parameter at SkeletonRenderer, defaults to disabled (previous behaviour). See http://esotericsoftware.com/spine-unity#Setting-Advanced-Parameters.

Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A").
If true, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes by e.g. the LWRP renderer, leading to incorrect draw order (e.g. "A1 B A2" changed to "A1A2 B"). You can leave this parameter disabled when everything is drawn correctly to save the additional performance cost.
Thanks for reporting!
We are just moving to LWRP and we found this issue.
The problem is: we have updated Spine Runtime to the latest version available (spine-unity 3.8, updated 2019-10-31), but that fix only seem to work when we go to Play Mode from an in-editor scene. It's not working on builds and neither when we change scenes from our initial game scene.
We are using Custom Materials for certain Skeleton slots.

Running standalone scene on Unity editor
Spine LWRP error - Running standalone scene on editor.PNG


Running scene on Unity editor from initial game scene
Spine LWRP error - Running scene on editor from starter scene.PNG


Edit:
Unity 2019.2.11f1
Lightweight RP v6.9.2
У вас нет необходимых прав для просмотра вложений в этом сообщении.
leonardo.bilck
  • Сообщения: 2

Harald

We are sorry to hear that.

Could you send us a minimal reproduction project where the problem still occurs? You can send a zip file to contact@esotericsoftware.com. Then we can have a look at it.
Аватара пользователя
Harald

Harri
  • Сообщения: 1116

leonardo.bilck

Sure, I'll send it to you as soon as possible.
leonardo.bilck
  • Сообщения: 2

Harald

After many test, I just noticed that disabling GPU Instancing at the material (Meio-Menino_frente_Rig01_Material) solved the problem on my PC. Could you please test if this resolves it on your end as well?

---

New unitypackages have just been uploaded where the Advanced - Fix Draw Order parameter automatically disables GPU instancing.
You can download it here as usual:
Spine Unity Download
Аватара пользователя
Harald

Harri
  • Сообщения: 1116


Вернуться в Unity