Using OmniLight3D as players vision(fog of war implementation)

Godot Version



Im working on a top down 3D dungeon crawler game and Im attempting to create an active representation of the players vision (anything not currently visible by the players avatar is blacked out [similar to fog of war]), my first thought was to see if I could render a 2D depth texture from the players avatars head in all 360 degrees around, but I dont think you can set a viewport to be only depth, plus the fov seems limited to 179 degrees.
My second approach was to use an OmniLight3D and a custom shader with a custom Light func for all surfaces in the game, this works but breaks if I want other point lights in the scene, for torches etc. In order to continue using my Omni light method I would always need the players vision light to either be first or last in the light passes but there doesnt seem to be anyway to set this to be permanent.

So I guess my question is:
Is there anyway to access a particular lights shadow map/texture and then set this to be global in the shaders?
Is there anyway to do a 360 depth pass with a viewport?

Or is there another approach you can think of that would work for a player vision/fog of war effect in godot? Im thinking my next avenue will involve post fx shaders but without a stencil shader Im not sure how to approach that either.

Many thanks