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

LightmapGI: Dynamic objects don't update immediately after baking lightmaps or (re)loading a scene #77167

Closed
Tracked by #56033
DearthDev opened this issue May 17, 2023 · 5 comments · Fixed by #97925
Closed
Tracked by #56033

Comments

@DearthDev
Copy link
Contributor

DearthDev commented May 17, 2023

Godot version

4.0 dev

System information

Windows 10

Issue description

When dynamic objects are baked, they will not receive global illumination from lightmap captures until they are updated by means such as toggling their dynamic status or by moving them. This issue seems to stem from the pairing code, which is not being executed on the instances following the baking process.

Steps to reproduce

  1. Add objects to a scene with their global illumination mode set to dynamic.
  2. Bake a lightmap.

Minimal reproduction project

N/A

@Calinou
Copy link
Member

Calinou commented May 17, 2023

@Calinou
Copy link
Member

Calinou commented Nov 10, 2023

I can confirm this on 4.2.beta da0b1eb (Linux, GeForce RTX 4090 with NVIDIA 535.113.01).

Minimal reproduction project: lightmap_2.zip

Before moving dynamic object After moving dynamic object
Screenshot_20231110_152025 webp Screenshot_20231110_152136 webp

@Calinou Calinou changed the title LightmapGI: Dynamic Objects Not Receiving Global Illumination Immediately After Baking. LightmapGI: Dynamic objects don't update immediately after baking lightmaps Nov 10, 2023
@Calinou Calinou changed the title LightmapGI: Dynamic objects don't update immediately after baking lightmaps LightmapGI: Dynamic objects don't update immediately after baking lightmaps or (re)loading a scene Sep 16, 2024
@SpockBauru
Copy link

I can confirm that it's still an issue on both 4.3 stable and 4.4dev2. In addition, the issue also happens if a character have the animation disabled.

Another way to trigger the issue is to hide/show the LightmapGI node. Test steps on the video:

  1. Hide/Show LightmapGI in order to trigger the bug.
  2. Enabling the animation fixes the bug on the character.
  3. Moving the capsule manually also fix the bug.
LightProbeBug.mp4

Test scene:

LightProbeEnableTest.zip

System Info:
Godot v4.4.dev2 - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.5186) - 12th Gen Intel(R) Core(TM) i7-12700KF (20 Threads)

@Calinou
Copy link
Member

Calinou commented Oct 17, 2024

I've made an MRP with additional scenarios for updating dynamic objects. If the rendering is happening correctly, the torus should be tinted red instead of having the environment lighting applied to it.

Minimal reproduction project: test_lightmapgi_dynamic_object_update.zip

Run the project and press the on-screen keys to (un)load the LightmapGI, the LightmapGIData, toggle the LightmapGI's visibility and the dynamic object's visibility. If this bug is fully fixed, the lighting on the dynamic object should always be rendered whenever the lightmaps are visible on static objects, without needing to toggle the dynamic object's visibility.

@Lamoot
Copy link

Lamoot commented Oct 19, 2024

As a user that's been recently learning about Godot's Lightmap GI, it'll be very nice once this issue is fixed.

It's a source of some frustration when trying to figure out whether I was missing something, I didn't read the documentation properly, or Godot is not working as intended.

Thank you for looking into it 🫡

@AThousandShips AThousandShips added this to the 4.4 milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants