The requirements for nodes related to river material

You can use the SceneDepth block to access the depth buffer of the scene.

For eg: