• Bugs
  • Spine-to-Unity export normal partly inverted

For shadow casting/receiving purposes I am using the standard shader in Unity. Most of the time it works fine, but in one of the exports the normal for one mesh is inverted. It happens when the the mesh becomes more complex by adding vertex points. If no vertex points are used in the mesh, the normal is pointing in the right direction without any problem.

I can't get my head around this since I've been using many meshes from before that are more complicated than this one without any problems.

Related Discussions
...

You can use other shaders for Spine rendering in Unity, but it requires that the shader you use has the following characteristics:

  • no backface culling
  • matches the premultiply alpha settings of your atlas export

If your shader writes to depth, you need to add z-spacing under the Advanced foldout to prevent z-fighting.
If your shader requires normals, check "Add Normals".
If your shader requires tangents, check "Solve Tangents"

ive noticed this too, it seems to happen quite frequently with meshes. But we render both sides so it doesn't matter fo us

After looking around some I found a minimalistic shader that turned off the backface culling, and it worked! Cheers for pointing me in the right direction. In case anyone else is looking, here's the source:

https://forum.unity3d.com/threads/2d-sprite-shadow-shader-jagged-edges.383659/

I got some kind of warning talking about material property block, but in my case a restart was enough to put Unity on the right track again.