Need help with depth buffer

From main camera I render my objects (with layer “One”), from another camera I wont to render objects (with layer “Two”) to Render Texture. But I how can I use depth from main camera? I need in render texture only objects from layer “Two” but if they overlapped by objects form layer “One” I don’t need it.

For example:
Green Cube in layer “Two”
http://forum.unity3d.com/attachment.php?attachmentid=41911&d=1355486443&thumb=1&stc=1
Now I have Render Texture
http://forum.unity3d.com/attachment.php?attachmentid=41912&d=1355486454&thumb=1&stc=1
But I need something like this
http://forum.unity3d.com/attachment.php?attachmentid=41913&d=1355486461&thumb=1&stc=1
Sorry for my bad English.



I am not understand your attention,but if you want a depth texture from a camera that is not the current one,i think you would have to render it to a depth texture,and set it to a texture variable in shader,and then refer to it

Yes, I want use depth buffer from the main camera, but can you help me with shader example?