Repository: godot
Issue: Vulkan: SDFGI leaks light into enclosed spaces, even when Use Occlusion is enabled
Labels: topic:rendering,documentation,topic:3d

### Godot version

Godot 4 nightly build

### System information

Windows 10 v20H2, Intel i7 6700, Nvidia GTX1080, 16GB RAM

### Issue description

Depending on distance from the subject mesh, SDFGI will unrealistically leak light into an enclosed or partially-enclosed space. This seems to be due to cascade switching due to the camera's proximity and will change as the camera approaches. These shifts otherwise appear as upscaling of GI detail but are highly noticeable in spaces where light should not be leaking. These spaces will begin bright and progressively darken.

This could simply be a limitation of SDFGI, but I thought it worth bringing to attention. This could not be resolved with quality tweaking (setting the cascades to the maximum of 8 and Y-scale to 50%) and adjusting the bias simply resulted in more extreme distortions.

### Steps to reproduce

SDFGI will show traces of light leaking in any project with an enclosed space. In my experience thickness does not seem to affect this since when SDFGI is having a minimal effect due to camera proximity, Godot will default to displaying the space without GI information. In many cases, an enclosed space will be brighter under these conditions than SDFGI would usually introduce after enough resolution has been achieved to accurately portray the lighting.

Since the steps to reproduce are not exact and slightly arbitrary, I have provided screenshots and a reproduction below.
At a distance, the light leak is quite obvious:
![SDFGI Light Leak 01](https://user-images.githubusercontent.com/70243134/126778241-ee338792-abc8-4e7f-8db6-400c53f33366.JPG)

As the camera moves closer, the leak changes in nature and reduces but is still visible:
![SDFGI Light Leak 02](https://user-images.githubusercontent.com/70243134/126778282-b4b4c89c-7828-49ca-a30b-0e378af6b67e.JPG)

Finally, when maximum resolution is achieved the resulting GI will be considerably different than at a distance:
![SDFGI Light Leak 03](https://user-images.githubusercontent.com/70243134/126778316-933ddb79-8ad7-48bf-9f2d-51d1e58e6a6c.JPG)



### Minimal reproduction project

I have provided an example file with a couple basic meshes and a capsule to represent the size of a regular player:
[SDFGI_Leaking_Bug.zip](https://github.com/godotengine/godot/files/6868570/SDFGI_Leaking_Bug.zip)

Here are some screenshots of the effects that may be observed:
The leftmost structure mimics the above example. From a distance, it appears that light is spilling in from the roof:
![SDFGI Light Leak 04](https://user-images.githubusercontent.com/70243134/126779078-0f12c15a-d0fc-41cd-abfa-b72b56682c50.JPG)

Upon closer inspection, the lighting adjusts and the space appears enclosed with some minor leaking in the left corner:
![SDFGI Light Leak 05](https://user-images.githubusercontent.com/70243134/126779153-7cd8db26-541e-475b-846e-4f03d141c5a8.JPG)

The rightmost structure is entirely enclosed. Although this improves the situation, there is still some noticeable leaking in the right corners. Some strange lighting artifacts will also appear on the walls as the camera travels through the space (not displayed here):
![SDFGI Light Leak 06](https://user-images.githubusercontent.com/70243134/126779330-d990bf98-8347-4ee5-82b5-3a98de4fb85d.JPG)

All shots taken with 8 cascades and a Y scale of 50%.