[solved] Help with stencil shader

I have this quad that is writing to the stencil buffer, which is my stencil mask. Over to the right there is an opaque cube that is working as intended, the quad masks it.

At the bottom i have a water shader that has a gradient color based on depth. But the quad is messing with the effect. I thought it would simply be ignored, since it doesn’t do any stencil stuff, but i guess the screen depth information accounts for it. Not sure how could i ignore it.

And at the left i have an additive particle effect that reads the stencil just like the cube does. But it only gets masked correctly by the quad if the particle effect is in front of it. When i move them behind the mask, they get occluded. What’s up with that?

Thanks for the help

All problems were solved by disabling receive and cast shadows on the Stencil Mask shader

Hi Tito,

I ran into similar problem, the model shows through stencil but particle system does not. My Stencil Mask Shader doesn’t have shadow setting. Any help is appreciated!

Shader script:

Shader "Unlit/Mask"
{
    Properties
    {

    }
    SubShader
    {
        Tags
        {
            "RenderType"="Transparent" 
        }

        Pass
        {
            Blend Zero One
            ZWrite Off
        }
    }
}