You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
There is currently no way to quickly override lightmap resolution by a global factor before the lightmap is baked. The main use case for doing this is for "preview" baking while iterating on lighting. A lower resolution can be used to speed up baking by a significant amount (often a factor of 3×-4×, if not more).
Godot 3.x has a Default Texels Per Unit property, but it only affects meshes that do not specify their own density. Most imported 3D scenes do define a lightmap texel density, as the Import dock will do so for you.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a property that multiplies the global lightmap texel size before baking lightmaps.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add a Texel Scale property to LightmapGI which scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales).
This feature is relevant for both the GPU lightmapper master and the CPU lightmapper in 3.x. While baking lightmaps is quite fast on master already, there are opportunities to make preview baking even faster, so let's seize the opportunity 🙂
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, but it requires reimporting all 3D scenes used in the current scene with a higher texel size value. Reimporting takes a lot of time to do in a complex scene, and it requires a lot of clicks throughout the day if you spend a lot of time iterating on lighting.
Is there a reason why this should be core and not an add-on in the asset library?
See above.
The text was updated successfully, but these errors were encountered:
Calinou
changed the title
Add a lightmap texel size multiplier in LightmapGI to speed up preview baking
Add a global lightmap texel size multiplier in LightmapGI to speed up preview baking
Jan 29, 2022
Seems to be working as expected, but I would like to talk about details like hint range or additional error messages (before submitting a PR). I decided to add a new BakeError for a case, when width or height of a lightmap_size is zero. In this case the editor will show quite precise error message.
Also this case may be related with godotengine/godot#63423. The patch will not solve the issue, but should show the error message instead of hang.
but I would like to talk about details like hint range or additional error messages
I think the hint string should be 0.01,100.0,0.01 (between 100 times more precise than default and 100 times less precise than default, with adjustments by 1%).
Related to #2029 and #3233.
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
There is currently no way to quickly override lightmap resolution by a global factor before the lightmap is baked. The main use case for doing this is for "preview" baking while iterating on lighting. A lower resolution can be used to speed up baking by a significant amount (often a factor of 3×-4×, if not more).
Godot
3.x
has a Default Texels Per Unit property, but it only affects meshes that do not specify their own density. Most imported 3D scenes do define a lightmap texel density, as the Import dock will do so for you.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a property that multiplies the global lightmap texel size before baking lightmaps.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add a Texel Scale property to LightmapGI which scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales).
This feature is relevant for both the GPU lightmapper
master
and the CPU lightmapper in3.x
. While baking lightmaps is quite fast onmaster
already, there are opportunities to make preview baking even faster, so let's seize the opportunity 🙂If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, but it requires reimporting all 3D scenes used in the current scene with a higher texel size value. Reimporting takes a lot of time to do in a complex scene, and it requires a lot of clicks throughout the day if you spend a lot of time iterating on lighting.
Is there a reason why this should be core and not an add-on in the asset library?
See above.
The text was updated successfully, but these errors were encountered: