• RuntimesUnity
  • URP Skeleton Lit shader shadow artifacts

I'm using spine assets in 3D space and using the shader Skeleton Lit shader, Universal Render Pipeline/Spine/Skeleton Lit.

It works really well for casting and receiving shadows, however, on some angles, the receiving shadows will cause some artefacts on the texture. You can see this in the gif below.

I'm using Unity 2022.3.4 (but it was present in 2021 LTS as well)
Packages are all up to date (pictured below)

Any help with this shader would be much appreciated.
Thanks 🙂

Related Discussions
...

@brogan Shadow casting artifacts (self shadowing, shadow acne) are likely due to the shadow casting settings (bias settings) at your light, and your quality settings regarding the number of shadow cascades.

Please check whether the same artifacts happen when using a non-Spine shader (e.g. any official Unity shader in the Universal Render Pipeline/* category). If so, it's likely unrelated to Spine, although to be sure you could also check whether a normal Unity sprite or a textured quad at the same position and angle has the same issues.

    4 jours plus tard

    Harald Hey, thanks for the reply.
    It does only happen with Spine materials. After some more trial and error and checking out the examples from the pack it turns out I needed to use the Universal Render Pipeline/Spine/Sprite shader, which handles casting and receiving shadows. No artefacts at all, not sure how I didn't discover this when I was first experimenting with different shaders... but oh well, I know for the future now.
    Thanks for your help 🙂

      brogan After some more trial and error and checking out the examples from the pack it turns out I needed to use the Universal Render Pipeline/Spine/Sprite shader, which handles casting and receiving shadows. No artefacts at all, not sure how I didn't discover this when I was first experimenting with different shaders

      This is very strange, the Universal Render Pipeline/Spine/Skeleton Lit shader should receive shadows just as well on a per-pixel basis (with the Receive Shadows material option enabled of course). Does the shadow have the shown artifacts with the Universal Render Pipeline/Spine/Skeleton Lit shader but display nicely with the Universal Render Pipeline/Spine/Sprite shader just by switching the used shader?

        Harald Yeah, basically. I had to drag the texture into the defuse property, but that was it really. It just worked and I can't replicate the same artefacts from the Skeleton Lit shader. 🤷 I'm just glad its working now 🙂

        Edit: I also had to check Fixed Normals as it had a strange tint to the material otherwise.

          brogan I had to drag the texture into the defuse property, but that was it really.

          When switching from Universal Render Pipeline/Spine/Skeleton Lit to Universal Render Pipeline/Spine/Sprite you should not need to re-assign any texture at the Albedo property, since this is the _MainTex property which is named the same at all shaders.

          Anyway, glad to hear that you've figured it out and that the problem can no longer be replicated.

          brogan Edit: I also had to check Fixed Normals as it had a strange tint to the material otherwise.

          If you don't provide the normals by generating them in the Advanced - Generate Normals setting in the SkeletonAnimation component, you need to enable fixed normals at the Universal Render Pipeline/Spine/Sprite shader, otherwise they will be uninitialized (random).

          The Universal Render Pipeline/Spine/Skeleton Lit shader on the other hand always assumes a fixed normal facing in object-local negative Z direction, as it does not support normal maps (and assumes no normal attributes provided at the vertex data).