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

Detect too high lightmap texel density and warn before baking lightmaps #59988

Closed
bosman697 opened this issue Apr 7, 2022 · 6 comments
Closed

Comments

@bosman697
Copy link

bosman697 commented Apr 7, 2022

Godot version

Godot_v3.4.4-stable_win64

System information

Windows 10 Gles2.0

Issue description

I create objects with collision save them as .tres , then i put thoose object on level. Them i add simple light and bakelightbox but when i press bake lightmap godot turn off . GI woks fine but i want bake lightmap becouse i using Gles2
https://gyazo.com/72eccb1755e3b27d09ce4503bc6b1a22

Steps to reproduce

just import mesh create collision and save as .tres next add this object to level them light and bake lightmap

Minimal reproduction project

https://we.tl/t-TSb6rFhv8W

Bugsquad edit: GitHub mirror of the above WeTransfer: New Game Project.zip

@adamscott
Copy link
Member

Please add a minimal reproduction project for the developers.

@bosman697
Copy link
Author

here https://we.tl/t-TSb6rFhv8W

@adamscott
Copy link
Member

here https://we.tl/t-TSb6rFhv8W

Usually, you can just drag and drop the zip file to the GitHub text area, no need to use external websites like WeTransfer.

Capture d’écran 2022-04-07 111158

@Zireael07
Copy link
Contributor

Unless the file is too large for GitHub attachments. But if it is small enough, GitHub attachments are strongly preferred to external sites because they're less likely to link rot.

@Calinou
Copy link
Member

Calinou commented Apr 7, 2022

Despite the quality settings being the default, baking lightmaps is taking an extremely long time in the test project:

image

This is because the lightmap texel density is too high on the subscene (due to the lightmap size for the mesh being too high). To resolve this:

  • Open SM_Floor400x400.tscn. Select the MeshInstance node within that scene.
  • Decrease the Lightmap Size property on the Mesh resource:

image

I recommend removing the last digit of each number here, so you end up with 438 and 933 for X and Y respectively.

  • Open the main scene and reload it (Scene > Reload Saved Scene) to make sure changes are applied.
  • Bake lightmaps again.

Here's the MRP with working lightmaps: New Game Project_1.zip


@JFonS We should figure out if it's possible to detect extremely high lightmap sizes and warn before baking (and possibly prevent baking in this case, with an adjustable project setting to bypass this). This would prevent wasting time when configuring lightmap size.

The alternative is to clamp the maximum lightmap size with a project setting, automatically using a lower texel density if needed. This could also be a solution to #54679.

@Calinou Calinou removed the bug label Apr 7, 2022
@Calinou Calinou changed the title Godot bake lightmap crash when scene contains subscene Detect too high lightmap texel density and warn before baking lightmaps Apr 7, 2022
@Calinou Calinou removed this from the 3.x milestone Apr 7, 2022
@akien-mga
Copy link
Member

Duplicate of #54679.

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

5 participants