Shader "Escape Room Engine/PortalStencil" {
    Properties {
        _PortalNumber ("Portal Number", Int) = 0
    }

    SubShader {
        Pass {
            ColorMask 0 // don't draw this to the main framebuffer

            Stencil {
                Ref [_PortalNumber]
                Comp Always // always pass
                Pass Replace // set stencil value
                Fail Keep // keep stencil if depth fails
            }
        }
    }
}