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

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 this issue Jul 29, 2024 · 1 comment

Comments

@Calinou
Copy link
Member

Calinou commented Jul 29, 2024

Describe the project you are working on

The Godot editor 🙂

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:

  • When a property is changed in LightmapGI, such as the bake quality or whether the denoiser is enabled.
  • When a LightmapGI-related project setting is changed:
    • rendering/lightmapping/primitive_meshes/texel_size
    • rendering/lightmapping/bake_quality/low_quality_ray_count
    • rendering/lightmapping/bake_quality/medium_quality_ray_count
    • rendering/lightmapping/bake_quality/high_quality_ray_count
    • rendering/lightmapping/bake_quality/ultra_quality_ray_count
    • rendering/lightmapping/bake_quality/low_quality_probe_ray_count
    • rendering/lightmapping/bake_quality/medium_quality_probe_ray_count
    • rendering/lightmapping/bake_quality/high_quality_probe_ray_count
    • rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count
    • rendering/lightmapping/denoising/denoiser
    • Other project settings in the Lightmapping section don't affect bakes, so they can be ignored here.
  • When any mesh that is eligible for baking (Static bake mode and valid UV2) is added, modified or removed compared to the previous bake.
  • When any light with the Static or Dynamic global illumination mode is added, modified or removed compared to the previous bake.

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
Copy link

passivestar commented Jul 30, 2024

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 #10323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants