I have a scene in Unity where I have two portals:
With Stencil Filter I want to render differents worlds in both portals. The green floor has this shader:
Shader "Custom/StancilFilter"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
[Enum(Equal,3,NotEqual,6)] _StencilTest ("Stencil Test", int) = 6
}
SubShader
{
Color [_Color]
Stencil{
Ref 1
Comp [_StencilTest]
}
Pass
{
}
}
}
While the portal on the right has this shader:
Shader "Custom/PortalWindow2"
{
SubShader
{
ZWrite off
ColorMask 0
Stencil{
Ref 2
Pass replace
}
Pass
{
}
}
}
I’m very new to shaders, and my question is: how can I prevent the right portal to render the green floor?