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

Vulkan: Error when baking LightmapGI if Bounces is set to 0 and there are no lights with Static bake mode #69129

Closed
Tracked by #56033
Calinou opened this issue Nov 24, 2022 · 2 comments

Comments

@Calinou
Copy link
Member

Calinou commented Nov 24, 2022

Godot version

4.0.beta6

System information

Fedora 36, Vulkan Forward Plus, AMD Radeon RX 6900 XT

Issue description

If Bounces on a LightmapGI node is set to 0 and there are no lights with Static bake mode, baking lightmaps will fail at the end. The lightmapper will write an OpenEXR file that Godot can't import: exr.zip

  Transient parent has another exclusive child.
  core/io/file_access.cpp:758 - Condition "f.is_null()" is true. Continuing.
  Unable to open file: res://.godot/imported/Scene.exr-f8a9d171130ce3b526802f87761ad0fc.ctexarray.
  Failed loading resource: res://.godot/imported/Scene.exr-f8a9d171130ce3b526802f87761ad0fc.ctexarray. Make sure resources have been imported by opening the project in the editor at least once.
  Failed loading resource: res://Scene.exr. Make sure resources have been imported by opening the project in the editor at least once.
  scene/3d/lightmap_gi.cpp:179 - Condition "t.is_null()" is true. Returning: ret
  core/io/file_access.cpp:758 - Condition "f.is_null()" is true. Continuing.
  Unable to open file: res://.godot/imported/Scene.exr-f8a9d171130ce3b526802f87761ad0fc.ctexarray.
  Failed loading resource: res://.godot/imported/Scene.exr-f8a9d171130ce3b526802f87761ad0fc.ctexarray. Make sure resources have been imported by opening the project in the editor at least once.
  Failed loading resource: res://Scene.exr. Make sure resources have been imported by opening the project in the editor at least once.
  scene/3d/lightmap_gi.cpp:179 - Condition "t.is_null()" is true. Returning: ret
Done baking lightmaps in 00:00:02.

A "Load Errors" dialog will also appear, as the resulting texture file is not valid:

image

The bake should complete successfully instead, even if setting Bounces to 0 with no lights that have their bake mode set to Static will result in a fully black lightmap.

Steps to reproduce

  • Ensure there are no other lights with the bake mode set to Static in the scene.
  • Set the LightmapGI's Bounces property to 0.
  • Set the DirectionalLight3D's bake mode to Dynamic (the default).
  • Select the LightmapGI node and click Bake Lightmaps at the top of the 3D editor viewport.

Minimal reproduction project

test_lightmapgi_leak.zip

@BlueCube3310
Copy link
Contributor

I'm unable to reproduce this in 4.3-dev 64520fe. The bake ends successfully, and the lightmap is solid black.

@akien-mga
Copy link
Member

Seems like this was fixed by 4.0-stable already.

@akien-mga akien-mga modified the milestones: 4.x, 4.0 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants