Current stencil implementation conflicts with the Unity UI masking stencils, which makes masked objects always visible on top of opaque Toon materials. This is undesirable.
The fix works in the following way:
The Outline pass should write Zero for both Pass and ZFail, this means that the outline pass fully overwrites the base pass stencil value, restoring it to how it should be
When the outline isn't used at all - the base pass should not write any stencil ref to avoid collisions with Unity UI. This can be done with the new SetProp DrawerFunction
Current stencil implementation conflicts with the Unity UI masking stencils, which makes masked objects always visible on top of opaque Toon materials. This is undesirable.
The fix works in the following way:
SetProp
DrawerFunctionImplementation of the
SetProp
: https://github.com/orels1/orels-Unity-Shaders/issues/29