Sara

Hi! I'm new with spine integration in Unity so I hope someone can help me.
I have a character and I want some particles to be shown only on certain parts (for example on the hair and clothes). I tried to separate it with Skeleton parts renderer but using a sprite mask won't work since it's not considered a sprite inside Unity. I think I need some of his parts to have a different shader with a stencil mask (and put a stencil shader to the particles as well) but I can't figure out how to change the default material for each slot. Can someone tell me how to do this or if there's an easier solution?

---

I realized I don't need to change the full shader but only the stencil ref with a material property block. It still doesn't work (it does when i change the reference manually on the shared material though) so I'm quite confused.
Sara
  • Messaggi: 2

Harald

In general you may want to have a look at the spine-unity documentation page, section "Materials" here:
spine-unity Runtime Documentation: Materials
Sara ha scritto: but I can't figure out how to change the default material for each slot.
Do you mean you want to change the Material for certain slots? Then you can use the SkeletonRendererCustomMaterials component to assign materials at slots:
spine-unity Runtime Documentation: SkeletonRendererCustomMaterials
If I misunderstood your question, please let me know.
Sara ha scritto:I realized I don't need to change the full shader but only the stencil ref with a material property block. It still doesn't work (it does when i change the reference manually on the shared material though)
Are you perhaps setting the MaterialPropertyBlock at the first Material only of the MeshRenderer, but are having multiple materials in use (more than one atlas page or blend mode)? Could you please share some screenshots that show the active Materials at your skeleton GameObject?
Avatar utente
Harald

Harri
  • Messaggi: 4164

Sara

Sorry for the late reply, I was working on some other stuff and came back to this today! I used the
SkeletonRendererCustomMaterial
component as you suggested and it worked as I wanted. I used stencil masking to make the particles visible only inside certain slots (the ones with the material that had the same stencil reference).
The material property block didn't work because some things were overriding others.
So thank you!
Sara
  • Messaggi: 2

Harald

No need to apologize. Glad to hear you've figured it out, thanks for letting us know! :)
Avatar utente
Harald

Harri
  • Messaggi: 4164


Torna a Unity