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

gltfpack: floating point attributes for normals #632

Closed
CITIZENDOT opened this issue Nov 8, 2023 · 7 comments · Fixed by #634
Closed

gltfpack: floating point attributes for normals #632

CITIZENDOT opened this issue Nov 8, 2023 · 7 comments · Fixed by #634

Comments

@CITIZENDOT
Copy link

Currently, positions can use floating point attributes with:

-vpf: use floating point attributes for positions

But normals are always quantized. I'm seeing little artifacts in the model with normal attributes which are not present in uncompressed model. When I reduced the quantization bits from default (8) to 4, the artifacts became severe => Artifacts are due to quantization.

I would love a flag to use floating point attributes for normals. Like below:

-vnf: use floating point attributes for normals
@zeux
Copy link
Owner

zeux commented Nov 8, 2023

I would recommend -vn 12 instead.

@CITIZENDOT
Copy link
Author

I have tried with -vn 16 and still seeing artifacts.

@zeux
Copy link
Owner

zeux commented Nov 8, 2023

If you're still seeing them with -vn 16 then I don't think they are normal-related, so I doubt floating-point normals would improve this -- or maybe there's some issue with -vn. Do you have a model you can share?

@zeux zeux added the gltfpack label Nov 8, 2023
@CITIZENDOT
Copy link
Author

Do you have a model you can share?

Yes. Models are quite large: https://drive.google.com/drive/folders/1lkT9YFSFEx-MgRC-G8YAaGlb3GDlz9Ow?usp=drive_link I also added a imgur post link so you can directly see the models without having to download them. I used https://gltf-viewer.donmccurdy.com to view models.

Let me know if you have viewed the models and I'll make the folder private,

@zeux
Copy link
Owner

zeux commented Nov 8, 2023

Thanks - feel free to delete the files, I'll need to debug this later.

@CITIZENDOT
Copy link
Author

Thank you!

@zeux zeux changed the title floating point attributes for normals gltfpack: floating point attributes for normals Nov 9, 2023
@zeux
Copy link
Owner

zeux commented Nov 11, 2023

This is a similar problem to #515 -- the model uses morph target based animation by just serializing keyframes as morph targets, and currently the range of normals is always [-1, 1] when quantized, so significant normal deformations see visible artifacts regardless of the number of bits used. On that model the animations are less aggressive so the issue is mitigated by clamping, but here clamping isn't sufficient. Using floating point normals would fix this; there may or may not be better alternatives though, we'll see...

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

Successfully merging a pull request may close this issue.

2 participants