Shader Graph Making A Wall Transparent If There's An Object Behind

Viewed 15

I'm trying to make a shader graph, which makes the object transparent if the player is behind it.

My approach was giving the player's(represented as a sphere here) depth as a parameter, and comparing it with the scene depth. Here is my shader and the result:

Shader graph example

And the result is:

Result image

The problem is, I want to make the red wall entirely transparent.

0 Answers
Related