Sampling Depth Buffer Outside Of Shaders

Godot Version

4.2.2.stable

Question

Hi, I am wondering if it’s possible to sample a depth buffer outside of rendering. It dosen’t need to be the depth buffer used for rendering the final image but one that’s made from the player camera. For context, I’m making something inspired by Scanner Sombre so I am raycasting from the camera to every mesh. I have already made a brute force implementation but for obvious reasons it is slow.