Using a depth mask and multiple cameras

Hi,

I am a relatively new user and I have run into a bit of a wall trying to use multiple cameras at different depths in conjunction with a depth mask.

I have been trying to use depth masks to create holes into geometry through which I can see the output of a second camera.

This has been done before, but despite following the same steps that others have written here How can I render a scene to a surface - Questions & Answers - Unity Discussions I have not had any success. Following those instructions, has anyone else been able to do this?

I have created the scene shown and written the appropriate shader (as well as experimenting with others) but all that happens is the object that is meant to be seen through remains the colour of the skybox and the results of the lower depth camera cannot be seen.

Any help would be appreciated, I have been trying for some time and I am sure that I am missing something obvious.

I am having the same problem here.
I can use depth mask inside the realm of one camera just fine.
With two cameras the masking also works with the camera that is set to Depth Only (kind of an overlay mode). So one could hide a GUI or something like that.
But I did not manage to cut a hole through the view that shows the Terrain and the Skybox to a previously drawn camera that is set to Depth Only. If I set the Clear Flags dropdown menu to skybox it just cuts all the way thrue a blueish color, though it still shows the terrain (but not grass on the terrain). I could restore the skybox by adding the code from this post.

I experimented with setting the shaders to different render queues but no success so far.

Unfortunately I am a complete noob as well to unity as to scripting, so I don’t know where to look next. Somehow this matter is very confusing to me, my poor brain…