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: LightmapGI does not take GridMap into account for baking #56030

Closed
Tracked by #56033
Calinou opened this issue Dec 17, 2021 · 4 comments · Fixed by #81545
Closed
Tracked by #56033

Vulkan: LightmapGI does not take GridMap into account for baking #56030

Calinou opened this issue Dec 17, 2021 · 4 comments · Fixed by #81545

Comments

@Calinou
Copy link
Member

Calinou commented Dec 17, 2021

See #56027 for the same issue with LightmapGI + MultiMesh, and #56031 for the same issue with GridMap + SDFGI.

Godot version

4.0.dev (1cbf394)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

LightmapGI does not take GridMaps into account for baking. On the left, you can clearly notice the indirect lighting, but it's completely missing on the right:

Left: Individual MeshInstances, right: MultiMeshInstance:

2021-12-17_18 30 58

This is a regression from 3.x, as GridMap + BakedLightmap setups worked there.

In comparison, VoxelGI works:

2021-12-17_18 32 33

VoxelGI lighting debug draw mode:

2021-12-17_18 34 02

Steps to reproduce

Note: An imported 3D scene with UV2 generated must be used. You cannot use primitive meshes for testing this, as they do not contain a UV2 layer and it can't be generated using the MeshInstance tools. The minimal reproduction project includes a ready-to-use setup for testing this.

  • Import a 3D scene with Static Lightmaps bake mode. Click Advanced in the import dock, go to the Meshes tab and enable Save to File. Specify a path to a .tres file to save.
  • Add a MeshInstance3D node with the mesh resource loaded to act as a floor. Scale it so it can fit several objects on top. Set the global illumination mode to Baked in the inspector.
  • Add a GridMap node. Use the GridMap menu at the top of the 3D editor to create a new item. Load in the mesh resource in the inspector. Place a few GridMap tiles at varying heights (Shift + Mouse wheel).
  • Add a LightmapGI, select it and click Bake at the top of the 3D editor viewport.

Minimal reproduction project

test_lightmapgi_gridmap.zip

With .godot/ included to workaround importing issue: test_lightmapgi_gridmap_1.zip

@williamd67
Copy link
Contributor

Opening the attached minimal reproduction project gives the following error on master:
Screenshot from 2021-12-24 10-36-06

Probably due to this, there is no UV2 for the gridmap:
Screenshot from 2021-12-24 10-36-46

I did not try to create the project myself. It would help if the project can be corrected.

@Calinou
Copy link
Member Author

Calinou commented Dec 24, 2021

@williamd67 This is strange. I couldn't reproduce this the first time I opened the freshly downloaded MRP, but I can reproduce this if I close the project, remove .godot/ and open the project again.

@williamd67
Copy link
Contributor

williamd67 commented Dec 26, 2021

My steps on Ubuntu 20.04:

mkdir ~/godot-working-directory
cp test_lightmapgi_gridmap.zip ~/godot-working-directory
cd ~/godot-working-directory
unzip test_lightmapgi_gridmap.zip
start godot (debug build: ./bin/godot.linuxbsd.tools.64) with the following options: --editor --path ~/godot-working-directory/test_lightmapgi_gridmap/

After that I get the following errors after opening:

-- Debug adapter server started ---
--- GDScript language server started ---
  Cannot open file 'res://.godot/imported/cube.glb-ec927bc01951d93b2130ba52799eca7c.scn'.
Switch Scene Tab
  scene/resources/resource_format_text.cpp:170 - res://Node3D.tscn:108 - Parse Error: [ext_resource] referenced non-loaded resource at: res://cube.tres
  scene/resources/resource_format_text.cpp:269 - res://Node3D.tscn:108 - Parse Error: [ext_resource] referenced non-loaded resource at: res://cube.tres
  servers/rendering/renderer_rd/renderer_storage_rd.cpp:1654 - Condition "!material" is true.
  Failed loading resource: res://Node3D.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_data.cpp:554 - Index p_idx = 1 is out of bounds (edited_scene.size() = 1).

It seems that the ext_resource is not properly re-imported when it does not exist in the .godot/ directory yet.

@Calinou, maybe, to unblock this issue, you can add the .godot/directory to the zip.

BTW: I have the same issue for #56027 and #55868.

@Calinou
Copy link
Member Author

Calinou commented Dec 26, 2021

@Calinou, maybe, to unblock this issue, you can add the .godot/directory to the zip.

BTW: I have the same issue for #56027
and #55868.

Done on all 3 issues 🙂

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.

4 participants