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

Lightmap Size Hint resets to 0 upon editor restart for imported meshes #28401

Open
needleful opened this issue Apr 24, 2019 · 2 comments
Open

Comments

@needleful
Copy link
Contributor

needleful commented Apr 24, 2019

Godot version:

Latest commit on branch 3.1

OS/device including version:

Lubuntu Linux, integrated Intel HD Graphics

Issue description:

I'm attempting to use BakedLightmap on meshes with UV2 layers unwrapped in blender. I can bake the lights as expected, but when I restart the editor, the light data is not displayed properly, and I cannot bake the lights again. This is because the Lightmap Size Hint for all the imported meshes resets to zero, despite saving the project, and I have to change the size hints and bake again. When I close a scene and reopen it, the size hint is preserved; it's only when I close the editor that the size is reset.

The documentation says the following regarding the lightmap size hint: "If you use external meshes on import, the size will be kept.". It's not clear to me what this is supposed to mean, but I assumed it was saying that this size hint is supposed to be preserved for imported meshes.

Steps to reproduce:

Create a mesh with 2 UV layers unwrapped in your modelling software of choice.

Import that mesh with "Light Baking" set to "Enable" in the import tab.

Create an inherited scene from your imported scene.

In that inherited scene, click to edit the mesh, and set "Lightmap Size Hint" to some positive numbers. Save the scene

Create a scene with baked lighting, and it should bake properly with your lights visible.

Close the editor and restart it.

The mesh will now have "Lightmap Size Hint" values of zero, and the light data will not be properly aligned with the mesh.

Minimal reproduction project:

custom_uv2.zip

If in the following project, the pipe model has a Lightmap Size Hint of 0 by 0, then you've encountered the bug, as I baked the lights with a lightmap of 16 by 16 pixels.

@KoBeWi
Copy link
Member

KoBeWi commented Aug 19, 2020

Still valid in 3.2.3 rc3, not sure about master.

@TheConceptBoy
Copy link

Still a problem in 3.3.4

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