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: Freeze when trying to bake with custom UV2 #63423

Closed
Tracked by #56033
WickedInsignia opened this issue Jul 25, 2022 · 6 comments · Fixed by #94237
Closed
Tracked by #56033

LightmapGI: Freeze when trying to bake with custom UV2 #63423

WickedInsignia opened this issue Jul 25, 2022 · 6 comments · Fixed by #94237

Comments

@WickedInsignia
Copy link

WickedInsignia commented Jul 25, 2022

Godot version

4.0 Alpha 12

System information

Windows 10, GTX1080, i7 6700

Issue description

Godot will freeze on the following screen while trying to bake a mesh with a pre-unwrapped custom UV2 layout (in this case, 3 meshes in an inherited scene).
Objects were imported as "static", not "static lightmaps" since that setting will overwrite any custom lightmaps.
This works fine in 3.4 with import set to "Light baking: enable".

DetermingAtlasSizeFreeze

Steps to reproduce

  • Open MRP
  • Open Mesh.tscn and check that a pre-unwrapped custom UV2 is used (the map should have minimal padding)
  • Open Scene.tscn
  • Attempt to bake the scene

Minimal reproduction project

CustomLightmapBug.zip

@MmAaXx500
Copy link
Contributor

I can confirm this on v4.0.alpha.custom_build [20d7171] with the MRP and with my own meshes. Attached a log for the MRP:
output.log (it says something about Intel, but the editor is running on an RTX 2080)

@DarioSamo
Copy link
Contributor

DarioSamo commented Sep 18, 2023

I'm unable to reproduce this on latest commit (e3e2528). The scene is also not lit for some reason despite the directional light being enabled. It is able to bake however.

image

Are the normals of the scene broken or something? The debug view does not look correct at all.

image

@Calinou
Copy link
Member

Calinou commented Jul 13, 2024

The scene is also not lit for some reason despite the directional light being enabled. It is able to bake however.

Baking works fine on my end as of 4.3.beta 97b8ad1, although there's some visible UV bleeding on the beveled boxes once lightmaps are baked (likely expected given the custom UV2 layout).

@WickedInsignia
Copy link
Author

WickedInsignia commented Jul 13, 2024

4.0 to 4.3 project conversion creates some oddities so I rebuilt the project with the same GLB mesh file. Now the reverse seems to be happening.
When I change the GLB's Light Baking from Static to Static Lightmaps in this project it freezes at Determining Optimal Atlas Size.
I also have to reload the main scene to see the changes in the lightmap UV. Hitting Bake after this with Static Lightmaps guarantees a stall for me.
If I change from Static Lightmaps to Static and don't reload the main scene, it still stalls.

customlightmapbugv2.zip
To recreate from here simply change Static to Static Lightmaps, reload the main scene and bake lightmaps.

EDIT: This was on 4.3 Beta 3. I haven't tried that newer build yet, will test tomorrow.

@WickedInsignia
Copy link
Author

Can confirm this still happens on 97b8ad1.
Just to be sure I rebuilt a similar mesh in Blender and strangely this one doesn't suffer the same issue. Something about the old mesh seems to be the problem. It was taken directly out of the project directory from the first MRP, so maybe had something to do with that.

Updated project file with new mesh:
customlightmapbugv2.zip

@BlueCube3310
Copy link
Contributor

The freezing is now caused by the atlas not being padded enough after the denoiser range PR, which will be fixed by #94236. Since this issue was reported long before that was a thing though, #94237 ensures that the process will now fail if an image cannot be blit into the atlas.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Jul 17, 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.

7 participants