Hello,
Out of the box this is not supported by the Spine shaders now.
However, you could create your own copy of a Spine shader which writes to the stencil buffer and draws a fully transparent pixel:
Replace the Stencil
line
Pass Keep
with
Pass Replace
to write to the Stencil buffer where the depth test passes (the pixel would be drawn).
Then also set the opacity of the pixel in the fragment shader to 0 like this:
fixed4 frag {
return fixed4(0, 0, 0, 0);
}
This should be enough to write to the depth buffer. If not, you could try changing the _StencilRef
parameter value from 1.0 to other integer values.