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

Add support for KHR_mesh_quanitization #400

Open
kvark opened this issue Dec 15, 2023 · 4 comments
Open

Add support for KHR_mesh_quanitization #400

kvark opened this issue Dec 15, 2023 · 4 comments

Comments

@kvark
Copy link

kvark commented Dec 15, 2023

thread '' panicked at 'assertion failed: (left == right)
left: 12,
right: 6', C:\Users\kvark.cargo\registry\src\index.crates.io-6f17d22bba15001f\gltf-1.3.0\src\accessor\util.rs:348:17note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

This is happening on "reader.read_positions()".

Example file:
Fostral-shape.zip

I suspect this is because gltfPack-0.20 outputs 16-bit integer vertex coordinates by default instead of 32-bit floating points.

@alteous
Copy link
Member

alteous commented Dec 15, 2023

Thanks for reporting. This model is using KHR_mesh_quantization which isn't handled by the reader utility.

The extension is marked as required in the example file, so the library ought report it as unsupported in some way. It begs the question: should the library reject any glTF that has unsupported extensions under extensionsRequired? In the next release there is an arbitrary extension API, so technically the burden would be passed onto the user.

A short term solution might be to fail creating the Reader for assets with extensions required matching *_mesh_*. Obviously, the long-term solution would be to add support for this extension.

@alteous
Copy link
Member

alteous commented May 10, 2024

#418 will now report an error if the crate can't handle a particular extension, including this one, so I've rebranded this issue as a feature request to add support for this feature.

@sotrh
Copy link

sotrh commented Jul 22, 2024

Is there no way to bypass the error if I need to use quantization @alteous ?

EDIT: looked at the docs and discovered from_reader_without_validation() and from_slice_without_validation().

@sotrh
Copy link

sotrh commented Jul 23, 2024

I created a PR for this #428

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

3 participants