• RuntimesUnity
  • URP Shader and other shader

If I want to use the Universal Render Pipeline/2D/Sprite-Lit-Default shader, should I just assign that shader in the Material section in the Inspector? I found some posts on the forum that suggest using Spine/Sprite/Lit, but I can't find it.

And is it okay to assign any shader I made to the Material in the Inspector?

Thanks!

  • Misaki відповіли на це.
    Related Discussions
    ...

    acai I'm not sure what you're trying to accomplish, so I don't know how best to advise you. Since you mention Spine/Sprite, I wonder if you want to use normal maps to do normal based lighting or receive real-time shadows, but what do you really want to do? How do you want your skeletons to look?

    To render skeletons in Unity projects using the Universal Render Pipeline, it is common to add the URP Shaders UPM package and use the shaders it provides. You can download the UPM package from the download page: https://esotericsoftware.com/spine-unity-download


    And is it okay to assign any shader I made to the Material in the Inspector?

    If you follow the "Writing your own shaders" section of the documentation, you should be able to use your own shader. It is generally better to duplicate the shaders provided for Spine and modify them as needed.
    https://esotericsoftware.com/spine-unity#Writing-your-own-shaders

    • Змінено
    • My question was, is this set up okay?

    (The above section is from the inspector.)

    • Misaki відповіли на це.

      acai

      My question was, is this set up okay?

      No, the default shaders in the Universal Render Pipeline are not suitable as-is for Spine skeletons. In general, you should use the Universal Render Pipeline/Spine/Skeleton Lit shader included in the URP Shaders UPM package instead.


      And in terms of the shader, I was going to make a shader using Amplify Shader Editor. Will the shader made with this asset be applicable to Spine 2D game objects?

      It should be possible, as there have been users who have tried it in the past, but since we do not officially provide detailed support, it may be relatively difficult. There was a user who previously provided us with a template for Amplify Shader, but when we updated our server the attached file was lost and is no longer available.
      It would be easier to get our support if you duplicate the shaders included in the spine-unity runtime or optional extension UPM packages and modify them for your use.

      • Змінено

      Thank you for your reply and the link.

      I have one more question:

      • What are the risks of using the "Universal Render Pipeline/2D/Sprite-Lit-Default" or other shaders? I created the shaders myself, and as I mentioned, these URP shaders work fine with Spine 2D animations in Unity. However, since you mentioned they are not suitable, I was wondering if they might cause errors in the build. Thanks for your help in advance. I am inexperienced with coding and just want to be sure.
      • Harald відповіли на це.
        • Змінено

        I changed lighting mode to Lit Universal 2D. Is this a correct approach?

        • Misaki відповіли на це.

          acai

          What are the risks of using the "Universal Render Pipeline/2D/Sprite-Lit-Default" or other shaders? I created the shaders myself, and as I mentioned, these URP shaders work fine with Spine 2D animations in Unity. However, since you mentioned they are not suitable, I was wondering if they might cause errors in the build.

          Please read the "Writing your own shaders" section in the spine-unity runtime documentation:
          https://esotericsoftware.com/spine-unity#Writing-your-own-shaders


          I changed lighting mode to Lit Universal 2D. Is this a correct approach?

          As I said in my first answer, I'm not sure what you want your skeleton to look like, so I don't know if this is right for you, but using the Universal Render Pipeline/2D/Spine/Sprite shader with the Lighting Mode set to Lit Universal2D will of course work. This is actually the same setting used for Stretchyman in the Spine URP shaders example scene. If you want to get the same lighting effect as this Stretchyman with a normal map, you should use this shader.

          acai What are the risks of using the "Universal Render Pipeline/2D/Sprite-Lit-Default" or other shaders? I created the shaders myself, and as I mentioned, these URP shaders work fine with Spine 2D animations in Unity. However, since you mentioned they are not suitable, I was wondering if they might cause errors in the build. Thanks for your help in advance. I am inexperienced with coding and just want to be sure.

          See the documentation section here. If you export your assets using straight alpha workflow and don't need special features such as Tint Black, you should not run into any problems using non-Spine (thirdparty) shaders like "Universal Render Pipeline/2D/Sprite-Lit-Default". You have to be sure of course to not use 3D URP shaders with a 2D Renderer (and vice versa), non-UI shaders on SkeletonGraphic (using a CanvasRenderer) and the like.

          Thank you for your help! I'll look into the documentation and explore Spine 2D further

          16 днів пізніше

          Thank you so much for the link! The set up for Premultiply Alpha vs Bleed is helpful

          • Harald вподобали це.
          3 місяці пізніше

          Harald
          Hello, I can't navigate to the specific web page through the link you provided.