Use transparency on stencil

Hello!

I have a problem with Stencil.
I saw this blog and tried to do the same to use it on a 3D card . :smile:

I create “Renderer Feature” that I attribute to layers. One for the items I want hidden and another for my window that will show them.

Renderer Features for Hidden Objects
7019539--831031--Captudre.PNG

Renderer Features for windows
7019539--831034--Capture.PNG

Unfortunately, I have a problem because my “windows” to see hidden objetcs do not work on transparent elements. :face_with_spiral_eyes:
All the elements with transparency (particles or assets with transparent material) disappear.

7019539--830992--Stencil Problem.gif

I guess the problem is with my “windows” shader

I

Shader "Custom/StencilMask"
{

Properties{}

SubShader{

Tags {
"RenderType" = "Opaque"
}
Pass{
ZWrite Off

}
}
}

I know that my render type is not transparent but the problem is that I am a beginner to shader and I don’t know what to put ^^ ’
I tried to replace it with

Tags {
“Queue”=“Transparent”
“RenderType” =“Transparent”
}

But that did not work :frowning:

If anyone has an idea ^^ ’

I’m not a specialist but:
It looks like you are rendering “Hidden Objects” AfterRenderingTransparent.
This effectively overwrites your transparent particle. (Try not transparent they will probably be on top)

BTW: If I were you I would probably try different approach than stenciling.
Render to texture comes to my mind.
The second idea I got is more complicated.

Thank I will check ^^