depth to ViewSpacePosition(4.3+)
Get the view space position from the DEPTH_TEXTURE (4.3+).
Apply this shader to a quad, which is attached to the camera.
Shader code
shader_type spatial;
render_mode unshaded, depth_draw_never;
uniform sampler2D DEPTH_TEXTURE: hint_depth_texture;
void fragment() {
vec4 clipSpacePosition = vec4(SCREEN_UV * 2.0 - 1.0, texture(DEPTH_TEXTURE, SCREEN_UV).r, 1.0);
vec4 viewSpacePosition = INV_PROJECTION_MATRIX * clipSpacePosition;
viewSpacePosition /= viewSpacePosition.w;
ALBEDO = viewSpacePosition.rgb;
}