I am trying to create an effect where some characters are invisible, except where they are overlapped by a certain material or other mesh between the camera and the invisible character. Wherever there is that other material or mesh intervening, their fully-rendered and lit pixels should show up.
This way I can make it so there is a special kind of glass substance in the game that allows you to see invisible ghosts and monsters through it.
I have tried using post process and custom depth to do this, but it fails when I make the monsters invisible by disabling their Render on Main Pass checkbox. The parts of them that are overlapped are still invisible
How can achieve this effect?