godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.34k stars 21.06k forks source link

Baking Lightmaps with LightmapGI breaks meshlibrary (Gridmap) transforms. #95436

Open patrickpluto opened 2 months ago

patrickpluto commented 2 months ago

Tested versions

System information

Godot v4.3.rc3 - Fedora Linux 40 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (nvidia; 555.58.02) - 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz (16 Threads)

Issue description

When baking lightmaps with LightmapGI, (VoxelGI untested) all transforms that I had saved into my meshlib revert, until I interact with the Gridmap again. Note that these transforms aren't the rotation I placed the grids with, rather the rotations I made while making the meshlibrary so they would all be properly aligned.

Steps to reproduce

  1. Get a random MeshInstance, doesn't matter where, it happened with GLTF files too.
  2. Rotate it while creating the MeshLibrary and Unwrap the UV2 for Lightmaps
  3. Save the MeshLibrary with the transforms you just made.
  4. Put a Gridmap in another scene and place some of that tile from the MeshLibrary
  5. Place a DirectionalLight, LightmapGI
  6. Bake lights on the LightmapGI and watch the rotated tiles ignore the MeshLibrary transforms.
  7. To undo the effect, interact with the GridMap, this will also destroy the Baked lights.

Minimal reproduction project (MRP)

Note: Created in 4.3 rc3 Just open level.tscn and bake the lights on LightmapGI, the effect should immediately become visible. Archive.zip

Calinou commented 2 months ago

cc @bitsawer