-
-
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
SDFGI Is Splotchy On Large Uniform Surfaces #50773
Comments
You can increase SDFGI's Probe Ray Count and Frames To Converge in the Project Settings to improve this. See also #39965. Increasing Probe Ray Count has a performance cost, whereas increasing Frames To Converge doesn't but will make indirect lighting take longer to update. For mostly static scenes, we could add an option to increase Frames To Converge even further (e.g. over 60 frames), but this will increase the delay for moving lights quite a lot. Edit: Done in #50796. |
Thanks! Will check this out and record the results if they’re significant. |
SDFGI is designed to be used in open world scenes first and foremost. For this use case, bounds don't really make sense and aren't really feasible on a technical level. Lightmaps are generally meant to be used exclusively for performance reasons, rather than blending them with other GI techniques (other than ReflectionProbe). If you use lightmaps, it's likely because GIProbe and SDFGI are too expensive for the hardware you're targeting. |
Ah good to know. Just trying to think of ways to reach the most flexible and good-looking compromise, but it seems like with some extra elbow grease SDFGI is the way to go on the whole. |
@WickedInsignia If you need more detail on an area, specifically and indoor area with a small but bright light source (like your test case), you can add a VoxelGIProbe. The VoxelGIProbe can blend over, or outright replace the GI contribution from SDFGI. |
If you want to play around the the number of SDFGI frames to converge associated to each setting, you can change this line and recompile the editor:
Note that the project settings' text will not change, but the value associated to each setting behind the scenes will be changed successfully. PS: It would be possible to change this project setting to allow setting any number of frames, rather than being limited to a few predefined settings. Note that you have to move or rotate the camera around a bit after changing the project setting to allow SDFGI to converge. This is because the editor only redraws when something on screen changes to save power. 30 frames to converge60 frames to converge90 frames to converge120 frames to converge150 frames to converge180 frames to convergeThere are diminishing returns to going further: |
@Calinou I am merely but an artist haha. I'll have a look into that solution but I'm using Godot as shipped since I don't have the experience to change or recompile the editor code. Optimally, the ability to get a less splotchy result would be an in-editor setting. That may be asking for a lot though! @clayjohn I hadn't tested GIProbe with SDFGI yet so I will give that a shot. Would using both together significantly reduce performance? |
@WickedInsignia It depends on your hardware and the settings you use. But you are combining the cost of both effects so it will be more expensive than using either technique by itself. Thankfully VoxelGi is not very expensive to use at runtime (it requires baking though). You can also run VoxelGI at half resolution to make it even faster at runtime. |
Another way to reduce splotches is to increase Bounce Feedback and decrease energy to compensate for the brighter result. This results in a more uniform look with more gradual fadeouts, which may be an artistic choice that's also useful to avoid overly dark areas: Bounce Feedback 0, Energy 1Bounce Feedback 0.6, Energy 0.5Combining this with a higher number of frames to converge can give you a very good result, which gets quite close to baked lighting in terms of quality. See #50796 for an example. |
Bounce Feedback will start having infinite feedback loops if the material receiving direct light is too bright. In most real world scenes, having such bright non-emissive materials over large surfaces is rare. In these scenes, a Bounce Feedback value around 1 can work in practice. Bounce Feedback values above 1 can also work in darker scenes that have few bright materials – this is why the inspector allows values up to 2.0.
To improve performance, enable Rendering > Global Illumination > Gi > Use Half Resolution in the project settings. This affects both SDFGI and VoxelGI, and improves performance significantly at a small quality cost. The quality difference is less noticeable at higher resolutions. I have a pull request enabling that setting by default: #49738 To reduce leaking, adjust the GIProbe's position/rotation/extents a bit, bake again and experiment with values that make leaking less noticeable. To avoid leaks in all situations, walls have to be thicker than 1 VoxelGI subdivision. For instance, if you use the default 128 subdivisions and your VoxelGI's size is
The With the CPU lightmapper, it's definitely possible to get nearly leak-free results like this: |
Awesome!! That’s really helpful, thank you. I’ll make sure to play with all of these a lot further and these tips will help a ton in my own projects. Also very thankful for you thoroughness, since it presents viable solutions for other artists who come across the same issues. |
Godot version
Godot 4 nightly build
System information
Windows 10 v20H2, Intel i7 6700, Nvidia GTX1080, 16GB RAM
Issue description
SDFGI displays severe splotching and pockmarking artifacts in low-light environments and especially on large uniform surfaces with little texture or model breakup. Although this splotching seems to always be present, it is mostly present in these circumstances.
Steps to reproduce
In the following examples I have a room with a single thin window letting directional light in as well as skylight. This scenario has been recreated in the attached project file below.
![SDFGI Splotchy 05](https://user-images.githubusercontent.com/70243134/126780033-794a4b65-523b-4b67-9f99-3adad9fa6495.JPG)
![SDFGI Splotchy 01](https://user-images.githubusercontent.com/70243134/126780227-d9ba9e5c-c943-4c8f-8326-edff8b0344e8.JPG)
Here, we can observe severe splotching of light and dark tones in a large bare room:
Even on smaller-scale surfaces and those with low detail frequency the splotching can be observed. Although it may look smooth from a distance:
![SDFGI Splotchy 02](https://user-images.githubusercontent.com/70243134/126780307-ba73844c-bf7c-4c49-8be5-b250c09cf1a2.JPG)
Splotching occurs when the camera moves closer and GI detail is increased in the area:
![SDFGI Splotchy 03](https://user-images.githubusercontent.com/70243134/126780368-620c7bf2-c03b-4d0b-b17a-0d4699b3cad5.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_Splotchy_Bug.zip
Here are some screenshots of the effects that may be observed:
![SDFGI Splotchy 06](https://user-images.githubusercontent.com/70243134/126781073-4f75b6ab-c867-4b0f-a899-c2afab7502c6.JPG)
The leftmost structure is only partially enclosed with plenty of light spilling in. Although the effect is hardly noticeable close to the light, further into the structure where the light has difficulty reaching there are highly visible artifacts:
The rightmost structure is considerably larger with a thinner opening for light to enter. Although there is no detail frequency in the space, the GI lighting artifacts are chaotic:
![SDFGI Splotchy 07](https://user-images.githubusercontent.com/70243134/126781185-b48136f6-ac43-48c1-a2a9-f68e150aa20f.JPG)
All shots taken with 8 cascades, Y scale at 50% and Occlusion and Sky Influence active.
The text was updated successfully, but these errors were encountered: