godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.26k stars 101 forks source link

Add an overlay for the editor when tweaking LightmapGI nodes that helps visualize lightmap density and UV overlap #12578

Open funkysandwich opened 1 month ago

funkysandwich commented 1 month ago

Describe the project you are working on

Any project that uses static lighting.

Describe the problem or limitation you are having in your project

When setting up static lighting for scenes in other engines, there's usually a tool to quickly visualize the density of a lightmap, which are very helpful when trying to determine the optimal lightmap resolution/density to bake at.

Unity's Global Illumination draw mode

Image

Unreal Engine's Lightmap Density view mode

Image

Godot does not have a tool for quickly visualizing this.

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

A bool property would be added to the LightmapGI node, that when enabled, would display an overlay over meshes the LightmapGI node will consider as part of the baked lightmap. This overlay would update in real-time when the Texel Scale property of the LightmapGI node is changed, and would help give an idea of the density of the lightmap before starting a bake.

The overlay should also highlight areas where lightmap UVs overlap. Lightmap UV overlap is not desired as it leads to artifacts.

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

Explained above

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

I'm not sure. I'm not experienced with editor scripting.

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

LightmapGI is a core feature, and this would improve the experience of tweaking LightmapGI nodes in the editor

spookto commented 1 month ago

This PR seems to implement this https://github.com/godotengine/godot/pull/96814 There is also a previous proposal for such a feature https://github.com/godotengine/godot-proposals/issues/3213, however, it didn't have the overlap highlights.

Calinou commented 1 month ago

The overlay should also highlight areas where lightmap UVs overlap. Lightmap UV overlap is not desired as it leads to artifacts.

How can these overlaps be detected (from a technical perspective)?

jcostello commented 3 weeks ago

UV Overlaping doesn't happen with the godot unwrap.

How can these overlaps be detected (from a technical perspective)?

UV island that share same coordinates are considered overlaping (talking about the same mesh)