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

Option to create secondary UV set for lightmaps at design-time import #238

Closed
Tripl3Design opened this issue Aug 31, 2021 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Tripl3Design
Copy link

I have a problem that the imported gltf's are not joining the bake process.
They are set 'static' but they are not changing.

I exported the models to gltf in another scene without materials.
I imported them and add the materials manually.

gltf_scene

@Tripl3Design Tripl3Design added the bug Something isn't working label Aug 31, 2021
@atteneder
Copy link
Owner

Hi @Tripl3Design ,

As far as I know models require a second UV set for lightmap baking to work. Here's a small test scene with a glTF(glb) cube. The left one has just one UV set while the right one has two:

image

As you can see, the right one has proper lightmaps applied to it.

Other importers (like the FBX importer) have an option to automatically create those for you, but unfortunately glTFast does not. I'll ask around if FBX's UV unwrapper could be re-used.

Regards

@Tripl3Design
Copy link
Author

Hi @atteneder,

Thanks for this fast reply!
This tool is awesome, can't wait for the runtime exporter.

I use this workaround:
Export the gltf to fbx, and use the fbx instead with 'Generate Lighmap UV's' checked.

@atteneder
Copy link
Owner

Thanks!

For the record:
There is an API for generating the secondary UVs, which could be integrated into the GltfImporter quite easily:

https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html

Keeping this issue open as a feature request.

@atteneder atteneder self-assigned this Aug 31, 2021
@atteneder atteneder added enhancement New feature or request and removed bug Something isn't working labels Aug 31, 2021
@atteneder atteneder changed the title gltf model not visible for lightmap Option to create secondary UV set for lightmaps at design-time import Aug 31, 2021
@atteneder atteneder added this to the 4.4.0 milestone Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants