• Unity
  • How are Slot Colours handled by the shader?

Related Discussions
...

I've been experimenting with Unity 2019's LWRP and the Shader Graph that now supports it, seeing if I can get a shader working with my Spine files. I've got it displaying a texture, the alpha gets cut out at a threshold value, it casts shadows, receives shadow & light... but the only missing bit that I can see is that colours for specific slots are not taken into account or displayed.

I've been hunting around the code (SpineMesh.cs in spine-unity) and while I'm seeing where the colours get added to the color buffer I'm confused as to how shaders are meant to access (or have that data passed to them) and multiply by the colour value per slot?

(I have PMA Vertex Colours checked on in the Skeleton Renderer settings.)


I've figured out the answer: vertex colours are not magically applied to the texture colours beforehand, as input to the shader. Take the texture RGB and multiply by the vertex colour, and there you go.

Glad you figured it out, thanks for getting back to us!