Orthographic cameras work with depth a little bit differently, but it's possible to access it through the Screen Depth node, which fetches depth values directly from the depth buffer as linear depth values.
Be sure to set the 'Convert To Linear' toggle option in its parameters to Off when working with an Orthographic Camera.
A simple way to access depth while using an orthographic camera would be through the use of the Camera Depth Fade node, as per the example below:
Do note that if the shader needs to access the depth buffer contents behind the object it is assigned to, then it should not be written into the depth buffer, and for that its Render Queue must be set to be greater than or equal to Transparent.
I'm not entirely sure on the type of effect you want to create, so you'll have to share additional details in order for me to assist any further. I hope that the information and sample shared above help!
I wanted to create Depth Fade effects, like one in ForceFields or Soft particles (https://prnt.sc/k5nmhf), it works fine with a perspective camera. But don't work with orthographic, even when I change the "Convert to Linear" setting in a "Depth Fade" node.
PS: Your example works fine, Just tested it. But "Depth Fade" and "Screen Depth" nodes do not work.
In order for the Depth Fade and Screen Depth nodes to work correctly in a certain object, that object must be written to the depth buffer, so you must make sure to have the ZWrite On and ZTest on Less or Equal.
Another detail to take into consideration is that objects that are marked NOT to cast/receive shadows are also not written into the depth buffer ( independently of the Z options ), so you need to have at least Receive Shadows toggled ON over the output node.
If you need for your object to not cast/receive shadows, then you'll need to go to its mesh renderer component and manually turn them off over there.
Yeah, I've checked all of this. In my case scene, everything has just a standard material and casting/receiving shadows. The problem is - everything (Depth Blend and Scene Depth) works in perspective, but don't work in orthographic and turning Off "Convert to Linear" doesn't help.
Cubes and plane in case scene all using standard material. The project using deferred rendering, but when I turn camera mode to orthographic it switches to Forward, but still render the Depth Texture, so it's ok.
From the tests we've ran yesterday, the depth nodes seemed to be working correctly with an Orthographic camera with the parameters that we've shared, including the Depth Fade and the Screen Depth nodes, providing that "Convert To Linear" is Toggled off. You might also have to adjust your camera Far/Near Clip values.
I understand that you want to create that specific effect you've shown in the video in a way that it presents itself the same way in Orthographic as it does in Perspective, however, do note that it's very tricky to achieve a similar visual look between different Projection types, meaning that you'll likely need to run a few additional calculations since depth works differently in each situation.
This Unity thread's discussion might help explain this situation and also provide a few possible workarounds.