I have been searching for the past 4 hours all over the internets, but didn’t find a single documentation for this - how can I pass depth texture (like i would _CameraDepthTexture using standard shaders) ?
I tried adding a second camera, passing a depth RenderTexture as its output texture, but it shows black and when i define _CameraDepthTexture in shader properties, I get an error saying I am redeclaring a property.
Thanks a lot, any help will be a massive relief.
It seems, that the scene depth node is broken in earlier versions than 4.8.0. Just upgrade your shadergraph version and it should work. Be careful though, upgrading shadergraph and your renderpipeline will probably break your shaders and you will have to reconnect the outputs manually again.
Running on Unity 2019.2.0a7 with a LWRP project, the shader graph version is 5.2.3, and this is the setup that gives depth based on the distance between the objects:
“Solved” by updating to (currently) staging version 4.0.1 which contains Scene Depth node. Finally finished intersection shaders in shadergraph, yay!