atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.23k stars 250 forks source link

Lightmaps not supported in Unity 2022.2.5f1 + URP #569

Closed hybridherbst closed 1 year ago

hybridherbst commented 1 year ago

Describe the bug I was very confused why lighting in my scene seemingly randomly broke, until I realized that

To Reproduce Steps to reproduce the behavior:

  1. Editor-import a glTF
  2. Set to static
  3. Add a light, set to baked
  4. Bake lightmaps

Expected behavior Lightmaps show up

hybridherbst commented 1 year ago

This also seems to be broken in UnityGltf. I assume ShaderGraph / URP changed their lightmap format and shaders would need to be reimported ... oh no

Also it looks like not all variants are affected, some are baking lightmaps just fine.

hybridherbst commented 1 year ago

Turns out that the material in question has, for whatever reason, metallicFactor: 1 in its actual material definition. So lightmaps will not have an effect on it after lightbaking. User error!

image