At first when you open godot shader and get the value for depth texture it is hard to understand how to use the data which godot provide to us in shader, In this video I tried to clear everything about depth texture or depth buffer in godot
depth buffer is useful in many cases like for water shader