godotengine / godot

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

New CPU Lightmapper crashes with GridMap when baking #45086

Closed DarkKilauea closed 3 years ago

DarkKilauea commented 3 years ago

Godot version:

Godot Engine v3.2.4.beta5+lightmapper.official

OS/device including version:

Windows 10 (Build: 19042.685, Arch: x64) AMD Ryzen 7 3800XT NVidia GeForce RTX 2080 (running GLES3)

Issue description:

I was testing the new CPU lightmapper proposed in #44628 with a simple GridMap. Whenever I try to bake the lightmap for the scene, I get a crash. Sample scene is attached.

Log:

Godot Engine v3.2.4.beta5+lightmapper.official - https://godotengine.org
OpenGL ES 3.0 Renderer: GeForce RTX 2080/PCIe/SSE2
OpenGL ES Batching: ON

ERROR: get: FATAL: Index p_index = 0 is out of bounds (size() = 0).
   At: ./core/cowdata.h:152

I tested the same scene with the official build of v3.2.4.beta5 and the lightmapper worked fine there.

Steps to reproduce:

  1. Create a scene and add a Gridmap.
  2. Create a MeshLibrary containing a cube as the only item.
  3. Paint a scene with the cube "tiles",
  4. Add some lights.
  5. Add a BakedLightmap node and cover the GridMap in its extents.
  6. Click the "Bake" button.

Minimal reproduction project:

TestGridmapLightmap.zip

JFonS commented 3 years ago

It was a simple error from my side, I already found a fix for it, but I'm waiting to update the PR together with some other fixes. I will keep you posted :)

DarkKilauea commented 3 years ago

Confirming that the issue is fixed in 3.2.4 beta 6.