-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan: SDFGI leaks light into enclosed spaces, even when Use Occlusion is enabled #50770
Comments
Check Use Occlusion in the environment SDFGI properties to reduce the amount of light leaking, and use thicker walls to make leaks even less noticeable. In general, global illumination techniques other than lightmaps will always require making walls thick. If you absolutely need thin walls and global illumination, it's better to use lightmaps instead. SDFGI occlusion has a performance cost, which is why it's disabled by default. Not all scenes will suffer from significant amounts of light leaking, so it's better to keep it disabled by default to avoid incurring a performance cost on people who don't need it. |
Occlusion is ticked on in these examples and the walls of the meshes are appropriately thick for what could be expected in a game space that blends interior and exterior spaces. In the case of the rightmost structure, the walls are considerably thicker than what could be expected in structures in-game. |
To reduce light leaking when using GIProbe, you can add additional geometry before baking GI then hide the geometry after baking, but it's not possible to do this with SDFGI due to how it works. SDFGI is planned to get a rework after Godot 4.0 is released, but I don't see any way to address this until then. |
That's all good and definitely what I expected. Since these effects aren't well-catalogued, I thought it best to take the time to make some examples. My hope is that if the issue is known and well-reproduced it will make future actions to address it a bit easier to identify. |
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:
As the camera moves closer, the leak changes in nature and reduces but is still visible:
Finally, when maximum resolution is achieved the resulting GI will be considerably different than at a distance:
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
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:
Upon closer inspection, the lighting adjusts and the space appears enclosed with some minor leaking in the left corner:
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):
All shots taken with 8 cascades and a Y scale of 50%.
The text was updated successfully, but these errors were encountered: