• Editor
  • Is there a way to mask things in Spine?

Related Discussions
...

I've already read that masking is something that Spine cannot do, but could you please help me out with an idea on how to make this effect for one of our characters?.

Image removed due to the lack of support for HTTPS. | Show Anyway

Image removed due to the lack of support for HTTPS. | Show Anyway

Image removed due to the lack of support for HTTPS. | Show Anyway

Our main protagonist in her final armor have this lights coming from beneath the grid on her torso/abdomen so in the image editor I created a grid and then I masked out those gradients of cyan so if I resize them it appears that they are moving outwards from the central point within the grid on her armour.

I don't know how to integrate that to the animation process in Spine I was going to do it via a shader that can overlap textures in Unity, but I can't use custom shaders on Spine objects because Spine already uses his own shader.

Any ideas on how to achieve this?

THANKS! Really appreciate all your feedback and responses 😉

Image removed due to the lack of support for HTTPS. | Show Anyway


http://www.facebook.com/alcyongames

It's possible you could do it using frame by frame animation (using linked meshes so you can deform the mesh holding the grid images). This would be relatively simple, but could potentially require a lot of work.
Here's an example project file using linked meshes that are deformed while changing which image is visible.
linkedMeshExample.zip

Another solution could be to create bounding boxes in Spine and then use them as masks for your grid images in Unity. I don't know much about shaders in Unity, but maybe Pharan can chime in here 🙂

I can't use custom shaders on Spine objects because Spine already uses his own shader.

Note that using Spine's bundled shader is not a requirement for using Spine in Unity.
You can use whatever shader you want as long as it renders the textures the way you want.

For example:

  • The bundled Spine/Skeleton shader is nothing special. It just does premultiply alpha blending, vertex tinting with an optional cutout shadow. Any other shader that does the same thing would act the same way.
  • If you saved your textures with straight alpha, you could just as well use Unity's Sprites/Default shader and it would work.
  • A forum user even posted a feature-rich sprite shader that can be used for sprites in general but is also compatible with renders of Spine skeletons. Sprite Shaders for Unity
Shiu wrote

Here's an example project file using linked meshes that are deformed while changing which image is visible.
linkedMeshExample.zip

Which version of Spine is used for that project? I can't open it. I'm using Spine 3.4.02
By the way, thank you both for your fast support! 😉

I'm going to try rendering straight alpha! Because another problem we have is that we can't use Spine characters with 2DxFX Unity asset pack from the asset store (that's why I was saying that we can't use custom shaders from other assets because Spine uses his own): https://www.assetstore.unity3d.com/en/#!/content/42566

Apologies for that. I uploaded using the latest beta by accident. I've uploaded the file again using 3.4.02 🙂

Thanks for the help! 😉
Now it works and I can see what you did!, I'm going to try and implement that in some way 😉