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

Increase the default texel size for lightmap baking #58071

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 13, 2022

This has several benefits:

  • Baking is now significantly faster out of the box (often twice as fast).
  • Lightmap texture file sizes are often divided by 2 or 3.
  • Baking requires less memory and is less likely to crash on large scenes.

Visual quality may be degraded, but it's usually not very noticeable in the default configuration where only indirect lighting is baked.

Testing project: https://0x0.st/o8oM.zip (link expires in October 2022)

Preview

Due to bicubic sampling not being reimplemented in master yet, the difference between the two texel sizes is more noticeable than it would be with bicubic sampling enabled. Once bicubic sampling is reimplemented, the quality loss will be less visible.

Indirect lighting baked only

Textured

This represents a typical usage scenario with a textured scene.

Before After
2022-02-14_00 08 59 2022-02-14_00 10 04

Untextured

This represents a worst-case scenario for lightmaps where the texel size difference is the most noticeable.

Before After
2022-02-14_00 08 53 2022-02-14_00 09 57

Fully baked lighting

Textured

This represents a typical usage scenario with a textured scene.

Before After
2022-02-14_00 07 06 2022-02-14_00 10 59

Untextured

This represents a worst-case scenario for lightmaps where the texel size difference is the most noticeable.

Before After
2022-02-14_00 06 59 2022-02-14_00 10 53

This has several benefits:

- Baking is now significantly faster out of the box (often twice as fast).
- Lightmap texture file sizes are often divided by 2 or 3.
- Baking requires less memory and is less likely to crash on large scenes.

Visual quality may be degraded, but it's usually not very noticeable
in the default configuration where only indirect lighting is baked.
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed with @JFonS that it's OK to increase this default, but we should probably have a warning system that can assess how much memory a bake would take and whether the texel sizes of the imported models are sensible for the size of the scene - since eventually what texel size makes the most sense is heavily dependent on the scene size.

@akien-mga akien-mga merged commit b95042a into godotengine:master May 10, 2022
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants