SDFGI works strangely with CSG object

Godot Version

4.2.2

Question

I built a tunnel using CSG Objects to test the light diffusion effect of SDFGI, and when I adjusted the Bounce Feedback value to 1 or greater, the tunnel kept getting brighter and brighter, while the interior of other buildings loaded from GLB was still darker.


Default (0.5)

When the value is equal to 1
Is this a bug or is it due to the special nature of the csg object?

This is expected, as high Bounce Feedback values will result in infinite feedback loop as described by the property’s description. This is particularly the case when you have bright materials in the scene (pure white albedo is a worst case scenario for this). The default value of 0.5 generally avoids this issue in pretty much all situations, so it’s recommended to stick to that.

If you need SDFGI to be brighter, increase Energy or add more lights/emissive materials to the scene.

1 Like

Things got weird, they behaved more normally in a white-walled space.


On the left are csg objects, and on the right are glb objects.
And with the same Bounce Feedback parameters, most of the rooms behaved darkly.

I would like to know how to adjust it to make the shallow rooms brighter and the deeper rooms darker.

I believe the default albedo color isn’t the same between CSG (which uses the fallback 3D material) and an imported glTF scene (which uses the material defined in the glTF, including the Blender default which is generally a bit darker).

A darker material will result in less bounced light.

As for your second example, the openings in the room are relatively small, so there isn’t much space for SDFGI to bounce light in. For situations like this, you’ll probably want to add an OmniLight inside the room to simulate some bounced light.

You can check what SDFGI “sees” in your scene using the SDFGI Cascades debug draw mode in the 3D viewport’s Perspective menu (it’s in the Display Advanced submenu).

1 Like

I just seem to have discovered a new issue: Omnilight has a negative property that works fine in the editor when opened, but instead glows in the actual game.


Omnilight with negative attribute at the end of the tunnel

Actual performance in the game
Addition: This issue only occurs when instantiated with other scenes, and will behave as in-game if placed directly.
image

This is because GI doesn’t take lights being negative into account currently, so they’re treated as additive lights within indirect light: Fix negative light rendering in global illumination by Calinou · Pull Request #86795 · godotengine/godot · GitHub

1 Like