Thank you for using the Simple See Through Shaders for Unity3d URP!
How to use:
To create the see through effect you will need at least 2 objects:
the object that should be rendered invisible by the mask
the mask object
The effect uses two shaders that must contain stencil instructions: mask and maskable. The Materials>Examples folder contains 6 simple maskable shaders created with shader graph and then turned maskable. (see "Masking your shaders" section below)
To create a mask object simply assign the SeeThrough Mask material to that object's renderer.
The See-Through Shader Converter will turn your Shader Graphs into shader files capable of interacting with the Mask shader.
To open the converter window go to Tools > Simple See-Through > See-Through Shader Converter (you can dock the window in the editor).
The Converter window has two fields: one for the path of the shader you want to mask, the second for the destination folder where the masked shader will be created.
To fill those fields simply right click on your shader graph then choose "copy path" and paste it in the "Shader to convert" field.
Repeat this operation for the Destination folder.
The checkbox labeled "HLSL file?" should only be checked if the shader you are trying to convert il already a shader file (hlsl). If so the converter will patch your shader file and ignore the destination folder.
Why can't we simply mask Shader Graphs shaders ?
Unfortunately we can't access the Stencil buffer from Shader Graph. The See-Through effect relies entirely on Stencils.
To use this Masked version of your shader simply create a material from it to use as any other material.
If you were to modify your original shader graph: reusing the converter with the same references will overwrite the previously created masked shader. Any created material using the old shader would automaticaly use this new shader.
If you do not wish to use the Converter, you can modify your shader code:
In the "Tags" section at the top of the subgraph, make sure that "Queue" is set to "Transparent+2".
After the "Tags" section, in the Subgraph before the "Pass", paste the following code:
Stencil
{
Ref 1
Comp NotEqual
Pass Keep
Fail Keep
ZFail Keep
}
Your shader code should look like this
Consider leaving a review: Asset store page