godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Emit a node configuration warning when LightmapGI properties, project settings or mesh/light data has changed, but lightmaps haven't been re-baked yet #10311

Open Calinou opened 1 month ago

Calinou commented 1 month ago

Describe the project you are working on

The Godot editor :slightly_smiling_face:

Describe the problem or limitation you are having in your project

After any change in scene geometry or lighting (for meshes/lights that have the relevant bake modes), lightmaps need to be baked to show up-to-date lighting information. No warning is currently provided for this.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Emit a node configuration warning when LightmapGI's properties or the primitive meshes texel size project setting is changed, but the LightmapGIData is outdated.

This would be equivalent to the good old "lighting needs to be rebuilt" message prevalent in other engines.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

This needs to be done at several levels, preferably with individual warning messages so the source of the need for re-baking can be tracked more easily:

This tracking should be performed by storing a copy of the baked properties in LightmapGIData, and comparing them to the current properties and project settings. The main difficulty will be tracking meshes and especially lights, as I'm not sure we have an inventory of which lights have been baked in LightmapGIData yet.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, as there's a lot of stuff to track, some of which isn't serialized to LightmapGIData yet.

Is there a reason why this should be core and not an add-on in the asset library?

This is about improving the iteration experience while working on level designs, and making sure you don't accidentally export a project with outdated lightmaps that can look broken depending on where the player looks.

passivestar commented 1 month ago

My problem with re-baking LightmapGI is that the node is rarely visible in the scene dock, it's usually scrolled somewhere else because there are a lot of nodes in the scene. So I would rarely see that configuration warning

What if the toolbar on top had optional icons for all things that can be baked that only appear when there's more than one of a node of respective type? They can display a hint themselves when something is out of date too and have dropdown menus to only bake specific nodes

1

Edit: opened a separate proposal for that https://github.com/godotengine/godot-proposals/issues/10323