• Unity
  • Slot Fading Behaviour with Spine UberShader is weird/bugged

Related Discussions
...

Hello,

we have the following issue: We are fading in / out a graphic with a Spine animation. We are doing this by setting the slot color's alpha in Spine and are exporting to Unity with "Premultiply Alpha" set to true.

We are using lighting and the Spine "UberShader" set to Vertex Lit/Premultiply Alpha mode for all of our assets. What happens when we play the animation is this:

The simple fade in on the glow from alpha: 0 to alpha: 1 somehow goes to black/grey before going to its real color (turquoise).

When we set the shader to the default "Spine/Lit", the fading works normally. But we need to use the UberShader for other reasons, so this is not an option.

Could someone look into this? Are we doing something wrong?

It can easily be replicated by fading in any transparent .png image via spine/slot animation, exporting as premultiply alpha to Unity and then using the UberShader to VertexLit/Premultiply Alpha

Edit: I just noticed that the 'UberShader' is called Sprite Shader now.

Unfortunately we could not reproduce this problem, it fades smoothly with Spine/Sprite/VertexLit on our test setup. Did you perhaps enable Write to Depth at the material shader properties?

Harald wrote

Unfortunately we could not reproduce this problem, it fades smoothly with Spine/Sprite/VertexLit on our test setup. Did you perhaps enable Write to Depth at the material shader properties?

We don't have "Write to Depth" enabled, however, we have a black environment lighting/ambient color, a directional light source rotated 90 degrees on the x-axis and we have Fixed Normals -> World-Space -> x: 0, y: 1, z: 0 enabled.
Maybe this could cause it?

EDIT: Even rotating the directional light differently and removing fixed normals from the shader, it still doesn't properly fade...

EDIT2: Alright, so apparently disabling "PMA Vertex Colors" on the SkeletonAnimation Component fixes the issue...? Never really understood what this does, anyway...

This sounds strange, as you said you are using the Spine/Sprite/Vertex Lit shader with blend mode Premultiply Alpha, having enabled PMA Vertex Colors would be the correct way. The description of PMA Vertex Colors can be found here on the spine-unity documentation pages, but I understand that PMA can be a bit confusing to understand.

I tried to reproduce the problem again using the additional information, but still it faded correctly with either PMA Vertex Colors enabled or disabled. If you want, you could send us a minimal reproduction Unity project as a zip-package, to contact@esotericsoftware.com, then we can find out what is going wrong here.