I've previously shown how to use stencils using the Amplify Shader Editor.
@MyroDev1.9K followers
33,937 views #VRChat
6 Comments
Comments from the original post on X (Twitter)

@MyroDev
Here's how I setup the window mesh. The mesh uses 3 materials : - The 1st material is applied to the frame, nothing special about it. - The 2nd material is used to render the city. - The 3rd material is used to render the avatar. I called the 2nd and 3rd materials "windows".
11 likes

@MyroDev
First of all, we don't need to render our windows, it's just a "portal". Under "Rendering", set "ZWrite = Off", "RGB Source Blend = Zero", "RGB Destination Blend = One". We also want to render our Window before the rest, so we set a lower render queue, here I set it to 1999.
8 likes

@MyroDev
The interesting part is in the stencil settings. - For our window materials, under "Rendering > Stencil", set "Stencil Pass Op = Replace" - For our scene and avatar materials, set "Stencil Compare Option = Equals"
6 likes

@MyroDev
Our first window should only render the scene, so ensure the "Stencil Reference Value" matches on both the window and scene materials. You can use any value except 0, I personally choose 1. This is because we set the "Stencil Compare Function" to "Equal", so the values must match
7 likes

@MyroDev
We need to do the same thing on our second window, but we will use a different "Stencil Reference Value", personally I choose 2. If you use outlines, make sure to apply the same settings under "Outline Stencil" Better explanations how it works
9 likes

@Fancy_vr
You can do some pretty neat tricks with stencils! And it's not only a tool for making these elaborate skits, I've seen people use it for small stylistic things like rendering eyes in front of hair
34 likes
