Clarification on LightmapGI and direct lighting/shadow baking

Godot Version

4.2

Question

Does baking lightmaps via LightmapGI bake only indirect lighting?

EXAMPLE:
I have a simple scene with four boxes and one OmniLight3D. The light’s Bake Mode is set to Static, and Shadow->Enabled is set to true. One of the boxes has an emissive material. When I bake the lightmap using a LightmapGI node, the indirect lighting is baked just fine, but the shadows cast by the boxes are not included in the bake. Is this intended behavior, or am I missing something?

If this is indeed how LightmapGI works and this node only bakes indirect lighting, is there a way to bake direct lighting?

EDIT: Uploading a better image to explain what I mean

1 Like

For lights with the Dynamic bake mode, yes. For lights with the Static bake mode, no: both their direct and indirect light are baked.

For meshes with emissive materials, both their direct and indirect light are baked when using the Static bake mode, and neither are baked when using the Dynamic bake mode.

That said, I’m not sure this is the source of the issue you’re seeing. The plane might have a lightmap texel density that’s too low to reasonably be able to see shadows being casted by static lights. Assuming you’re using primitive meshes (and not an imported 3D scene), try decreasing Rendering > Lightmapping > Primitive Meshes > Texel Size in the Project Settings to a value like 0.05 and bake lightmaps again.

Note that shadows from emissive lighting are harder to see, as the emissive surface is larger than a light by design. This makes its shadows more subtle and blurrier, like it would in real life.

3 Likes