KhronosGroup / UnityGLTF

Runtime glTF 2.0 Loader for Unity3D
MIT License
1.81k stars 491 forks source link

Lightmaps for gltf models are reset when reloading the scene. #787

Open Greenf1re opened 3 weeks ago

Greenf1re commented 3 weeks ago

Describe the bug 💬

After baking lightmaps, if I reload or export the scene the lightmaps are reset. It does not happen if I use Unity's meshes or FBX files. Might be an issue with generate Lighmap UVs.

https://github.com/user-attachments/assets/0003132d-58dc-4d51-8dff-8052b12f43dd

Steps to reproduce 🔢

  1. Download files
  2. Place a point light inside one of the enclosed areas; set to Mixed or Baked.
  3. Bake Lightmaps.
  4. Reopen the scene, export, or cause the scene to be reloaded in any way.
  5. The lightmaps are reset and the enclosed area is dark again.

Files to reproduce the issue ♻

r111_t.zip

Editor Version 🎲

2021.3

Render Pipeline and version

URP 12.1.15

UnityGLTF Version

2.13.0

Operating System 👩‍💻

Windows

When does this problem happen?

Additional Info 📜

No response

Validations 🩹

pfcDorn commented 4 days ago

Hey, i can't get it to reproduce it. Also the Gltf part should not have any influence on baked lightmaps after inporting. The imported assets will end up in standard Unity Assets like Mesh and Texture2d. Can you check if your baked lightmaps are still exist in den Scene folder? And also check the GameObject MeshRenderers for lightmap informations?