[Shader Help] Using stencil buffer in post processing shader?
Yo. I'm trying to have a post processing effect use the stencil buffer but I just can't seem to get it to work. The stencil mask works.
Now, what I'd like to do is have a post processing effect that gray scales everything inside/outside of the stencil mask. I've got a simple gray scale post processing effect using Graphics.Blit
But everytime I try to use a stencil read in the shader it's just a black screen.
If I change the it to **Ref 0** everything is shown. It doesn't work because it seems like the buffer is cleared. I've tried this and this but I just can't get it to work. Anyone have any ideas how to fix this?
Ultimately, I'm trying to make this effect.
Using Unity 2019.1.0f1
Now, what I'd like to do is have a post processing effect that gray scales everything inside/outside of the stencil mask. I've got a simple gray scale post processing effect using Graphics.Blit
But everytime I try to use a stencil read in the shader it's just a black screen.
Stencil { Ref 1 Comp Equal }
If I change the it to **Ref 0** everything is shown. It doesn't work because it seems like the buffer is cleared. I've tried this and this but I just can't get it to work. Anyone have any ideas how to fix this?
Ultimately, I'm trying to make this effect.
Using Unity 2019.1.0f1
monaco-1.gif
961 x 504 - 1M
monaco-2.gif
961 x 504 - 1M
monaco.gif
873 x 434 - 7M
Comments
Shows a little from the back end
So, I still have a stencil mask mesh. Then I duplicate that mask mesh and give it a separate layer, that's rendered to a render texture. That render texture is then fed into the grayscale post effect.
@dark_seth are you referring to the cracking platforms? One white and one gray texture? Could you elaborate.