+4 votes


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?

in Engine by (16 points)

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.

same, still no answer

1 Answer

0 votes

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.

by (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.