godotengine / godot

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

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

Closed Calinou closed 5 months ago

Calinou commented 1 year ago

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

Minimal reproduction project

test_lightmapgi_leak.zip

BlueCube3310 commented 5 months ago

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

akien-mga commented 5 months ago

Seems like this was fixed by 4.0-stable already.