I am trying to bake light-map for an interior scene. I am currently using Godot 4.2.
1)As you can see the corners of the walls remain very dark.
2)Objects(door) which are set up to use dynamic light only use light map when they are moved a little either in game or in editor.
I had the same issues in the earlier version of the engine.
Can you please help me in solving these issues?
Do you have AO turned on?
Yes. But keeping it turned off made no difference.
It occurs to me that perhaps you have not double checked that the normals on your mesh are properly aligned and that those dark vertices are pointing the wrong way.
In Blender (or your 3D editor of choice), select all vertices and use “recalculate normals” to fix this, then reimport the mesh.
I recalculated the normal in blender and it didn’t work . I tried changing the light map texel size to 1x while importing the mesh in godot and it fixed the issue. But it created another issue as you can see in the screenshot.
I am out of ideas. If you have the project online somewhere I can take a look, but just from screenshots… I just don’t know why that would happen.
I can share a minimal version online. Can you please take a look?
Here is the link to the project :
I am not sure what is going on exactly, but setting the quality higher gets rid of the noise, so clearly part of the problem is you’re baking a massive area to a single texture. But that’s not all, because your blender files have procedural walls, I assume you imported those directly, which means you did not unwrap the UVMap yourself, which means the UVs are whatever size godot guessed. If you look at the texture the bake makes you can see the illuminated area is tiny and there’s a lot of black. With custom UVs you’d get more detail where it matters. But that’s not all. Because the inner corners of your geometry are not actually connected AND the texture space is so limited, the edges that are in the shadow cause a gradient to show.
Basically, you need to be more careful and make better models if you want to have pretty shadows. As far as I can tell, those are the issues here. All in the way the meshes are created, not in the baking or importing.
Thanks Efi, I will try again by manually unwrapping all the UV2s.
Even if you do that, you definitely have to fix the vertices that are inside or behind another volume, since that’s the main cause of the wrong shadows, even tho some of them will disappear into the geometry with better UVs.
This is a known issue: LightmapGI: Dynamic objects don't update immediately after baking lightmaps · Issue #77167 · godotengine/godot · GitHub