How do I convert a world space coordinate to a screen uv in a shader?

Godot Version



When working on the shader for this other question, I got it mostly working, but could not figure out how to convert a world position (namely, the light position) into the SCREEN_UV space. I need the world space coordinate to get the sdf coordinate via screen_uv_to_sdf.

Is there a way to get the SDF or SCREEN_UV coordinate for a world position in a shader?