• RuntimesUnity
  • I can't make the OUTLINE work in my skeletongraphic

hello!
i'm trying to implement an outline in my skeleton (ui), but using the default SkeletonGraphicOutline is not working properly, and I've tried tweaking some parameters in the material with no success.
Here's what my SkeletonGraphic looks like with default material:

and here's what happens when I change its material to SkeletonGraphicOutline:

as you can see, a bunch of problems. first of all, it's showing only the outline, and my original avatar is gone. besides, the lines aren't supposed to go on top of each other, as all I want is an outline of the whole skeleton, not its individual slots.
here's the material inspector:

What can the problem be? Thanks in advance!

    Related Discussions
    ...

    hiknapolitano as you can see, a bunch of problems. first of all, it's showing only the outline, and my original avatar is gone. besides, the lines aren't supposed to go on top of each other, as all I want is an outline of the whole skeleton, not its individual slots.

    Sorry to hear you're facing problems. Both problems stem from the same origin, the "normal skeleton" should be drawn in a second render pass on top of the outline pass around every slot, which makes it appear as a combined outline around the whole skeleton (the second normal pass hides the inner outlines behind it).

    I see nothing obviously wrong with your material settings or described setup, could you please send us a minimal Unity project which 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.

      Harald I don't know how far I'm allowed to share the stuff of the company I work in, but I'll try to do that! Thanks for the reply.
      Could the problem be in the way the skeleton was exported in Spine, perhaps? Should any option be checked or something? Do you have any ideas for me to try in the meantime? Thank you again!

      @hiknapolitano In case you can't share a minimal reproduction project, could you please share some screenshots of the Unity Inspector component settings at the problematic GameObject (especially of the SkeletonGraphic component, with the Advanced section expanded, and please also of the CanvasRenderer).

      Could the problem be in the way the skeleton was exported in Spine, perhaps?

      If possible, please also share the skeleton export settings with us, both the main export settings as well as the atlas texture export settings under "Pack Settings".

      Nevertheless, it is rather unlikely that export settings would make the main pass transparent while still having all attachments visible in the outline pass.

        Harald Sure thing!

        Does that bring anything to mind? Thanks again for replying, I really appreciate the help on this one

          hiknapolitano Thanks for the update. Unfortunately I still can't spot anything wrong in your settings.

          Could you please check whether the example scene Outline Shaders URP inside the URP shaders package displays correctly for you, after hitting Play and hovering over the rightmost character? It can be found at the following location (under Packages in the Project panel):
          com.esotericsoftware.spine.URP-shaders/Examples/Outline Shaders URP

            Harald In my project, I could only find the "Outline Shaders URP" scene under "Packages/Spine Universal RP Shaders/Examples", but it's unfortunately missing a lot of references for scripts and sprites. Someone who worked on this project before may have deleted a lot of example stuff from the project before me, I guess.


            Could that be related to the reason the Outline is not working anywhere? Are there scripts or external things other than the Outlined materials and their shaders that should exist in the project for them to work properly?

              hiknapolitano In my project, I could only find the "Outline Shaders URP" scene under "Packages/Spine Universal RP Shaders/Examples",

              @hiknapolitano This is the correct scene, no worries.

              hiknapolitano but it's unfortunately missing a lot of references for scripts and sprites. Someone who worked on this project before may have deleted a lot of example stuff from the project before me, I guess.

              This is not good. If perhaps the shader files have also been modified, that would obviously explain why the outline shader don't work as expected. You should be able to check the modifications of the whole directory (in the main spine-unity package directory, Spine\Runtime\spine-unity\Shaders) in your version control system (git, Perforce, or whatever you're using).

              hiknapolitano Are there scripts or external things other than the Outlined materials and their shaders that should exist in the project for them to work properly?

              The SkeletonGraphic outline shader file requires some include files, so if any are missing, the respective shader pass will then not compile, which might be the case in your project. You should then see some notes about compilation errors when you have the outline shader active in your scene and select the shader file Spine-SkeletonGraphic-Outline located in the main spine-unity package at Spine\Runtime\spine-unity\Shaders\Outline\SkeletonGraphic.

              Also check if the material SkeletonGraphicDefaultOutline really uses the above shader and the shader name reads Spine/Outline/SkeletonGraphic

              In case you don't immediately find any issue with modified files, please have a try if re-installing a clean version of the spine-unity runtime in your project resolves the issue. You may of course want to create a backup of your project first, in case any modifications to the runtime were intentional and necessary for your project.