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

Incorrect import result for quantized model by gltfpack #693

Closed
wayne-wu opened this issue Feb 12, 2024 · 5 comments
Closed

Incorrect import result for quantized model by gltfpack #693

wayne-wu opened this issue Feb 12, 2024 · 5 comments
Assignees

Comments

@wayne-wu
Copy link

I'm trying to get UnityGLTF to work with files compressed using gltfpack but have been getting incorrect results.

For example, this rigged character does not get imported correctly after running gltfpack whereas both gltf Viewer and gltFast import the model correctly before and after quantization. Even something as simple as the Avocado has different results before and after quantization.

UnityGLTF (Original) UnityGLTF (Quantized) gltFast (Quantized)
image image image

I'm guessing it has something to do with quantization and the extra node transform that's applied by gltfpack, but I can't be sure yet. If I run gltfpack with -noq (disable quantization) then it imports fine.

Unity Version: 2021.3.31f1
UnityGLTF Version: 2.9.0-rc

Any insights would be appreciated!

@hybridherbst
Copy link
Collaborator

Thanks for the report! cc @pfcDorn, would be great if you take a look.

When you drag the UnityGLTF (quantized) import into the scene, does the model show up? I remember there being an issue about the bounds of models being incorrect in some cases, which breaks Unity's model preview, but doesn't actually break the imported model.

@pfcDorn
Copy link
Contributor

pfcDorn commented Feb 13, 2024

I guess you are right. Mesh is there, but it get not rendered. But also not in Scene view. I will take a closer look
image

@pfcDorn
Copy link
Contributor

pfcDorn commented Feb 13, 2024

hm...it seems to be more an scale issue here. When i set the import scale to 65000, then it has the same size as the gltfast import. So maybe it's a quantization issue here

pfcDorn added a commit to prefrontalcortex/UnityGLTF that referenced this issue Feb 13, 2024
@pfcDorn
Copy link
Contributor

pfcDorn commented Feb 13, 2024

I have fixed it :)
There was just missing some checks if the quantized data should be normalized or not

@pfcDorn pfcDorn closed this as completed Feb 13, 2024
@hybridherbst
Copy link
Collaborator

Please only close PRs when the fix has actually landed in a release!

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

No branches or pull requests

3 participants