• Runtimes
  • Monogame and Multiply

Hello! I have been struggling with how to make 'Multiply' slots work because I don't think I quite understand how it is supposed to be done.

The pink area of the image above is a background that I want to use in as "Multiply" blending mode. When I change the blending mode it shows up perfectly in the editor, but when I switch to the runtime, it shows up as the picture above with no blending being applied. I went ahead and made a pre-multiply shader and passed that to the SkeletonRenderer, but with no luck, it still shows up as a solid color.

There is no example in the Monogame runtime example about how this shader could look like and the Unity version isn't helping much on how to do it as a HLSL shader. I understand that I should be giving the shader the ["Projection"] matrix parameter with the width and height of the viewport, but other than that it is a very simple alpha blending shader.

I suppose that the problem is that my shader is wrong, but I was wondering if maybe I' just missing something very obvious.

I am exporting the project with "Premultiply alpha" enabled and with JSON version 4.0 because I haven't ported my main project to Core from Framework, so I am stuck using an old runtime for now. I highly doubt this could be causing an issue.

Thank you.

Related Discussions
...

Using a very old runtime can indeed cause this issue, because we generally don't backport fixes in newer runtime versions.

We've actually fixed multiply and screen rather recently in the 4.2 runtimes. You can try to port this to your spine-monogame version:
EsotericSoftware/spine-runtimes66392e8

I do however strongly suggest to update the runtime. There's only been a single relevant API change between 4.0 and 4.2, so it should be super simple to update from a code perspective. As for updating your exports from 4.0 to 4.2, you can write a command line script that this this in an automated way for you. See:

https://en.esotericsoftware.com/spine-command-line-interface