Baked lightmap not visible when playing the scene but shows in 3D editor

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By akre


I’m trying to use BakedLightmap in Godot 3.1. After I bake the lightmap, it shows on the mesh in the 3D editor, but when I play the scene, the mesh only has a flat or solid color, almost like it’s unshaded. A LightMap.png is created in the res:// folder, and it contains different colors, so it looks like the bake worked.

I’ve tried toggling unshaded and disable ambient light flags in the material and shader, changing clear color and ambient light color and energy, and using spatial versus shader materials. I also tried switching the editor between GLES3 and GLES2. None of those seemed to make a difference.

What should I do?

To clarify, toggling the unshaded flags and changing light energies makes a difference in that the flat color on the mesh becomes, e.g., solid white, black or grey, but doesn’t seem to make the lightmap visible.

akre | 2019-04-01 17:59

same, still no answer

Favkis | 2020-07-24 12:53

:bust_in_silhouette: Reply From: JakSparro98

I got recently into a similar problem in Godot 3.3.2, I had a mesh saved as tscn that was linked to a gltf mesh instance since I needed to frequently reload the mesh in Blender without the pain of moving it into the game every time, turns out that if you have a similar setup you need to enable light baking inside the import preset settings and chose “Gen Lightmaps”, you also need to discard already existing uv layers you manually generated that were previously only showing into the editor and not into the game as the engine will use only the ones it auto-creates from the import to correctly render both in the editor and the game view.