Hello everyone,
My situation is the following (Unity):
we have our character (it has lots of skins), and want to have the character silhouette (with same skin) show when it is behind walls.
I read that we can use the stencil buffer to do this (walls write a number to the stencil buffer and then our character's silhouette material can compare to that number and tell the stencil wether to render it or not).
What I'm afraid is that I would have to duplicate my character so the original material renders normally and the copy as a silhouette.
Spine automatically detects and applies at runtime and at all times the corresponding material to the character and its skin on Unity, so I can't manually change what material to use. If I duplicate the character and make changes to its material at runtime (I'm using spine/sprite shader) for example to tint it red and also to make the stencil comparison it applies to both character and silhouette as they share the same material.
How can I change through code the material of the duplicate without affecting the original character? (both share the same spine material assigned by its skin/atlas/etc)
I'm afraid and somehow sure that its not a real solution to duplicate the whole character folder in order to have a silhouette material for the corresponding skin and the original material.
I hope my question is clear to understand.