-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Change LightmapGI Global Texel Scale to Texels Per Unit #9116
Comments
Switching to texels per unit sounds good to me. It can be done without breaking compatibility by adding compatibility handlers that automatically set the new property to the correct value (
A single mesh can be featured in several LightmapGI instances in several scenes at different scales, so this approach is unfortunately not viable with the 1:1 mapping expected between the source mesh and the imported mesh (including its UV2). |
I considered this incorrectly: unwrapping should happen on import but island positioning should happen at bake time, for the reason you mentioned. Which is how it's handled in other engines and I assume already happens in Godot. My mistake! What would be useful is a Min Lightmap Res and Min Object Scale prompt on import, which tells the unwrapper to pad and position islands upon unwrap to suit the minimum lightmap res and scale expected by the user. Or an island padding prompt to a reasonable default (for say, 10 texels per unit or whichever is a somewhat standard quality level). Unity currently uses the former, and used the latter in earlier iterations. Either option would prevent defining the texel resolution on import, since defining it then is a major inconvenience in a lightmapping workflow and requires an arbitrary multiplier to be used in LightmapGI rather than a global Texels Per Unit setting. Removing the need to multiply on top of what's defined on import would allow for Texels Per Unit to be used instead. |
It's mostly a historical decision (also because these power-of-two values allow for optimal usage of the lightmap UV space). This is being tracked in #3233. |
Describe the project you are working on
Graphics-intensive demo scenes
Describe the problem or limitation you are having in your project
Right now Godot doesn't have any way to define Texels Per Unit.
This format of measurement is essential to obtaining reliable and predictable lightmap quality/scale results.
All methods to define lightmap texel density rely on arbitrary units.
Lightmap Texel Size in the import dialgoue is an arbitrary decimal:
Global Illumination Settings in a Mesh Instance's properties is a multiplier based on that arbitrary decimal:
The global Texel Scale in Lightmap GI is an arbitrary multiplier based on that arbitrary decimal again:
It makes no sense to use these undefined and unrecognized units of measurements in lightmapping. Nowhere in the interface nor the manual does it state how these decimals relate to the standard Texels Per Unit or how they precisely relate to the lightmap image itself.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Unity lets the user define a Texels Per Unit size globally in the lightmapping dialogue. In this case "unit" refers to meter, so if you input 40 you will get 40 pixels in lightmap space per meter on each mesh surface:
This is predictable, efficient and easily visualized. In the below image each checkerboard tile represents 1 pixel in the lightmap. This is for a scene with 5 texels per unit:
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
Will be used often.
Is there a reason why this should be core and not an add-on in the asset library?
Core functionality.
The text was updated successfully, but these errors were encountered: