godotengine / godot

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

LightmapGi bake freeze when generating volume probes for a large level with large amount of probes #83972

Closed jcostello closed 7 months ago

jcostello commented 1 year ago

Godot version

v4.2.beta.custom_build [e8d57afae]

System information

Ubuntu with Nvidia 2060

Issue description

When baking probes for the TPS demo with a lot of manual LightProbes placed across the level, the baking process got stuck forever without doing anything in Generating Light Probes Volume

Steps to reproduce

Download MRP (it is the TPS demo setted with lightmap probes ready to bake) Open Level2.tsn Bake the lightmap

Minimal reproduction project

https://www.dropbox.com/scl/fi/vvz4yeoa4b4aaqmu4pjjf/tps-demo-4-test.zip?rlkey=h5qidqjqcgg62ulx0thsecxhl&dl=0

akien-mga commented 1 year ago

I tried to reproduce the issue, but that project outright crashes for me on 4.2-beta3 and latest master (2564026bccb74f0efa0a69b8df05bd3dea18e24d), on Linux.

Got two different types of stacktraces:

Another attempt after deleting .godot lets me open the editor, but then when I confirm the dialog to upgrade all meshes, it gives an error with one of the plugins and crashes after spamming

Unicode parsing error: Invalid unicode codepoint (adef59c0)
Unicode parsing error: Invalid unicode codepoint (ac000090)
Unicode parsing error, some characters were replaced with � (U+FFFD): NUL character
Unicode parsing error, some characters were replaced with � (U+FFFD): NUL character
Unicode parsing error, some characters were replaced with � (U+FFFD): NUL character

So there are definitely many bugs exhibited here but it's hard to reach the point where the LightmapGI can be debugged. This project would need to be cleaned up so that it can be opened in 4.2-beta3 without a billion errors. Many of the errors reported can be traced back to changes in 4.1 with the handling of .001 Blender suffix.

jcostello commented 1 year ago

I will try clean the project some how

jcostello commented 1 year ago

@akien-mga try again building master with the latest pull. The project opens fine for me

permelin commented 7 months ago

The reason the editor seems to hang is that this scene generates so many warnings that the message queue gets full. You can increase memory/limits/message_queue/max_size_mb in the project setttings for that. But because of the underlying problem, the editor will likely just crash instead.

I'm working on a PR that will reduce the amount of warnings, but for this particular scene the main problem seems to be #90138 and I don't have a solution for that.

A tip to reduce warnings in general and improve the quality is to not place probes too close to each other. Placing many probes closer than a couple of meters from each other is asking for trouble. In this scene there are probes that are only a few centimeters apart. Don't do that.

screenshot