Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

I've previously shown how to use stencils using the Amplify Shader Editor. Today, I found out that the Poiyomi shader supports stencils. Here's how you can replicate this effect using that shader, it's gonna be a long thread. (1/6) #VRChat

32,674 Aufrufe • vor 1 Jahr •via X (Twitter)

6 Kommentare

Profilbild von MyroP
MyroPvor 1 Jahr

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".

Profilbild von MyroP
MyroPvor 1 Jahr

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.

Profilbild von MyroP
MyroPvor 1 Jahr

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"

Profilbild von MyroP
MyroPvor 1 Jahr

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

Profilbild von MyroP
MyroPvor 1 Jahr

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

Profilbild von Fancy
Fancyvor 1 Jahr

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

Ähnliche Videos