Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BakedLightmap doesn't properly light dynamic objects #69098

Open
Tracked by #56080
Jamsers opened this issue Nov 24, 2022 · 7 comments
Open
Tracked by #56080

BakedLightmap doesn't properly light dynamic objects #69098

Jamsers opened this issue Nov 24, 2022 · 7 comments

Comments

@Jamsers
Copy link

Jamsers commented Nov 24, 2022

Godot version

3.5.1.stable.official

System information

Windows 11 22H2, GTX 1650 Mobile, NVIDIA Driver 526.98, GLES3

Issue description

Dynamic objects within a BakedLightmap seem to be lit incorrectly compared to their baked static object counterparts. While I'm not expecting perfectly matched lighting, I would expect dynamic objects to at least "fit in" reasonably well in a static lightmap baked environment.

BakedLight1_Godot
BakedLight1_Unity

(The projects pictured above can be found at GodotLightingTest and UnityLightingTest.)

Steps to reproduce

Create an enclosed room with an opening to allow some skylight and direct lighting in. Enable lightmap baking for all elements the room is made out of.
Put an object in the room, and disable lightmap baking for this object. This is our dynamic object.
Put another object right next to it, and enable lightmap baking for this object. This is our static object.
Bake lightmaps.
The lighting won't match between the two objects.

Minimal reproduction project

GodotLightmapIssue.zip

@BraqueDown
Copy link

Hiding the BakedLightmap node seems to show the correct indirect lighting:

On

image

Off

image

@Jamsers
Copy link
Author

Jamsers commented Nov 24, 2022

Hiding the BakedLightmap node seems to show the correct indirect lighting

It brings it closer, but I think it is most definitely not correct. The color tint seems to at least be correct now but they don't seem to even be within the same luminosity bracket.

I would expect dynamic objects to at least "fit in" reasonably well in a static lightmap baked environment.

BakedLight1_Unity

Did I make any mistakes with the way I set up the lighting/nodes in the minimal reproduction project? The lighting difference is so severe I feel like I missed something.

@BraqueDown
Copy link

Okay, so it turns out that hiding the node "fixes" the indirect lighting because it completely disables dynamic indirect lighting from the lightmap (the "Capture" tab). Definitely seems borked.

@Jamsers
Copy link
Author

Jamsers commented Nov 24, 2022

Interesting (and kinda amusing) to note that this seems to be broken even in the official 3D Global Illumination Demo:

image
The box next to the green reflective sphere is the same (albedo) color as the walls.

@Calinou
Copy link
Member

Calinou commented Nov 24, 2022

Dynamic object capture is pretty broken in 3.x – I wouldn't rely on it. Rendering is far from the only issue it has – the files it creates are huge, for instance. The 3D global illumination demo has dynamic object capture disabled for this reason, so objects in the shade appear fully black.

Backporting the dynamic object capture system from 4.x would be ideal, but it's a lot of work to do and won't happen for 3.6 unless a motivated contributor does the required work. Its rendering also needs to be fixed first.

I would suggest you take a look into this if you can, as most rendering contributors are focusing on 4.x nowadays.

PS: Try switching to GLES2, baking lightmaps again (with atlases disabled) and see if you can reproduce the issue there.

@Jamsers
Copy link
Author

Jamsers commented Nov 24, 2022

Thank you very much, it's at least great to have confirmation that it's indeed not working and I didn't make some goofy mistake with my lighting setup. 😅

Just to confirm, the only working ambient lighting models for 3.x seem to be GIProbe (with no ReflectionProbe: GIProbe+ReflectionProbe seems to break lighting as well, although that's another topic) and WorldEnvironment background lighting, right?

@Calinou
Copy link
Member

Calinou commented Nov 24, 2022

Just to confirm, the only working ambient lighting models for 3.x seem to be GIProbe (with no ReflectionProbe: GIProbe+ReflectionProbe seems to break lighting as well, although that's another topic) and WorldEnvironment background lighting, right?

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants