godot icon indicating copy to clipboard operation
godot copied to clipboard

Lightmap Probes applying to dynamic objects offset by LightmapGI node orientation.

Open Braxtogoo opened this issue 1 year ago • 10 comments

Tested versions

  • Reproducible in: v4.3.rc1.official [e343dbbcc], v4.3.beta3.official [82cedc83c], v4.2.2.stable.official [15073afe3]

System information

Godot v4.3.rc1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.3742) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)

Issue description

When using lightmap probes they apply based on the LightmapGI node's rotation and position. This leads to odd behavior if your node is rotated in odd directions. And can allow for baked lighting to be "moved" or "spun" in run time. The baking doesn't seem to be affected by this but how the effect is applied is. Below are some examples of the light probes applying their effect to dynamic objects while the LightmapGI node is rotated to be upside down and backwards.

Examples: Two emissive cubes, the sphere in the middle is dynamic: image

Note that the over kill amount of light probes show the light on the correct sides. image

Another example of a sphere with an emissive cube and a static spotlight, it happens when the spot light is baked dynamic as well. (Note that I turned off the spot light's direct light to make the effect more apparent.) image

Light probes once again, look correct. image

Finally, here's an example showing that it happens with regular lights as well, here's the sphere centered under the spot light with the direct light turned off, as you can see, based on the light probes it should be getting more indirect lighting from below, however even without the direct light it appears brighter on top. image

Probes: image

You can even spin the lighting in real time! Here I've centered the LightmapGI node on the sphere and I rotate it with the editor. Moving the position of the node will have similar results. output2

Steps to reproduce

  • Make a basic scene with static and dynamic geometry, emissive objects, static or dynamic lights, Lightmap probes, and a LightmapGI node.
  • Configure LightmapGI node, rotate it in a direction that's not (0, 0, 0), make sure all static geometry has a UV2 and adequate space on the lightmap, turn off preview light and world environment if you don't have your own.
  • Bake lightmap.
  • To see the effect more clearly disable light's visibility to disable their direct light.
  • (Note, you may have to wiggle dynamic objects, maybe another bug but lightmap probes don't seem to apply to them until they move once for me.)

Minimal reproduction project (MRP)

  • Open project.
  • Turn off preview directional light.
  • You may have to wiggle the dynamic objects, I've noticed they don't seem to get the effect of the lightmap probe until they move.
  • Look at the 2 dynamic spheres as you move them around.

I did also add a camera to the scene to make sure it wasn't just an editor only bug. Hitting play also shows the bug, however I had to wiggle the sphere with the remote inspector panel to get the lightmap probe to apply to the sphere, this feels like a separate bug, I've reported it here #94825.

Backwards_Lightmap_Probes.zip

Braxtogoo avatar Jul 27 '24 02:07 Braxtogoo