Hello everybody, I've been trying to use the URP outline shader following the example scene but my characters get the outline in all their parts, not sure if there's a way to improve this so it only shows the outline of the character as a whole instead of each piece?



Here are my settings for one of the characters, also tried to increase the Region Padding to 4 and 8 without any changes.

Any guidance whould be appreciated! I feel there's something missing, perhaps the way they were make in the Spine editor?
Using version 4.0

Thanks a lot!

Related Discussions
...

@Towanime Sorry to hear you're facing problems! The problem lies only on the Unity side, it has nothing to do with the Spine Editor or export settings. Could you please show your Material setup at the problematic skeleton in Unity, how many materials are used and what shaders and Material properties are used there.

It might be related to the issue discussed in the following forum thread here:
https://esotericsoftware.com/forum/d/24307-multiple-materials-outline/5

Sure! What I usually do is drag&drop the exported files into the Unity editor and let it do the automatic creation, something might be failing there.

Then this is usually the result, it creates two materials, a normal Material one and other Material-Screen.


This is how the Skeleton Data Asset is created

Now for the Outline I duplicate the normal _Material file and change the shader to Outline-Only

AND this is the gameobject with the RenderExistingMesh component added

This is the original Spine Mechanic Game Object in my game, even if when importing it creates two materials it's only listing one.

This is another character I have with the same issues but something weird happens when importing it, the spine object has a list of 3 materials instead of two, the first one repeats and can't remove it in the inspector.

Hope this is enough information so we can figure out something! It's running on Unity 2020.3.4f1 and the Spine package version is: spine-unity-4.0-2021-09-01.unitypackage

Thanks a lot again.

    Thanks for sharing the additional details! Unfortunately I can see nothing obviously wrong with your setup, if your skeleton has a single material active (thus rendering the skeleton in a single draw call) there should be no problem rendering outlines. Could you please send us a minimal Unity project that still shows this issue? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context. Then we can have a look at what's going wrong.

    Towanime This is another character I have with the same issues but something weird happens when importing it, the spine object has a list of 3 materials instead of two, the first one repeats and can't remove it in the inspector.

    It depends on your attachment visibility and draw order, see the documentation here:
    https://esotericsoftware.com/spine-unity#Materials

    3 meses más tarde

    Thanks for sending the reproduction project.

    You need to add a little bit of Z offset at the outline-only GameObject named GameObject in your example scene, otherwise Unity will sort it to be rendered after (and thus on top of) the main skeleton mesh in your case. So set the GameObject's Transform Position Z value to e.g. 0.01.

    BTW: in spine-unity 4.1, we have added a RenderCombinedMesh component for the purpose of further improving support for rendering outlines with multiple-submesh skeletons, see the FAQ section here under "The Outline shader displays inner outlines around skeleton parts. Why?".

    Extra: Just noticed the Spine examples of the outline shaders don't work on my project or the new one either... They don't look like these ones.

    Spine URP shaders are separate from Built-In Render Pipeline shaders. This also applies to outline shaders. The Outline Shader URP example scene is located here:
    com.esotericsoftware.spine.URP-shaders/Examples/Outline Shaders URP
    Likely you had a look at the Built-In Render Pipeline Outline Shaders example scene, which like all scenes using special Built-In RP shaders will display incorrectly with URP.