godot: CPU lightmapper capture doesn't make use of the environment lighting

See also https://github.com/godotengine/godot/issues/46332.

Godot version: 3.2 Git 4f891b706

OS/device including version: Fedora 33, GeForce GTX 1080 (NVIDIA 460.39)

Issue description:

The new CPU lightmapper’s dynamic object capture doesn’t make use of the environment lighting. This occurs in GLES3 at least, but I remember it happening in GLES2 as well.

While peeking around in scene.glsl, I noticed there’s code for environment lighting in the lightmap capture shader but I can’t seem to find a way to enable it.

BakedLightmap visible

Environment lighting is not used, only probe lighting is. This is fine in theory, but since the capture probes don’t have environment lighting baked in, it looks bad.

2021-03-02_15 25 16

BakedLightmap hidden

Environment lighting is used as the lightmap capture isn’t used when the BakedLightmap node is hidden. Note that the lightmaps still affect the baked mesh though – whether this is a bug or not is a separate issue.

2021-03-02_15 25 33

Steps to reproduce:

Add a BakedLightmap node, add two MeshInstances (one baked, one not baked), bake and move the non-baked mesh around.

Note that the DirectionalLight is hidden in the MRP to work around https://github.com/godotengine/godot/issues/46332.

Minimal reproduction project: test_lightmap_shadow.zip

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

@SkanerSoft The latest PR that was merged (will be available in the RC5 realease) adds the new property “Environment -> Min Light” in BakedLighmap. That should give you some control over the darkest areas in the lightmap 😃

Yes, I’m working on adding an option to enable environment lighting on dynamic capture objects, but it didn’t make it to the RC4 release.

It is perfectly! I completely trust your solutions, with the next update I will definitely try and report everything! Finally, I would like to ask the last question. Is it possible to somehow limit the darkness? This means not turning the shadow completely black.

That is, in the same way, you can specify the color of the shadow from a light source, which can be not only black.

Image 002

If this is not possible, your work is still amazing! And thanks to you, my game looks a million times better!