8000 How to enable draco support? · Issue #215 · jkuhlmann/cgltf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

How to enable draco support? #215

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

Open
AllenDang opened this issue May 10, 2023 · 4 comments
Open

How to enable draco support? #215

AllenDang opened this issue May 10, 2023 · 4 comments

Comments

@AllenDang
Copy link

I noticed in the README states the draco is supported. But I cannot find any instruction but only a #define CGLTF_EXTENSION_FLAG_DRACO_MESH_COMPRESSION seems related.

How to enable it?

@zeux
Copy link
Contributor
zeux commented May 16, 2023

cgltf will parse files with Draco data, but it doesn't have the automatic decompression integrated; similarly to EXT_meshopt_compression, you need to integrate Draco library, and give it the byte stream that you can get from the buffer_view for the mesh with Draco data. If you're looking for examples, Filament should have one (see https://github.com/google/filament/tree/main/libs/gltfio/src)

@raysan5
Copy link
Contributor
raysan5 commented May 18, 2023

Ignore message, commented on this issue while trying to comment on raylib one :P

@abwood
Copy link
Contributor
abwood commented Jun 6, 2023

I think we should probably provide some documentation on how to do this in the Readme. In the meantime, I added this functionality to cgltf and tinygltf. If you have a look at tinygltf source, you'll see how the bufferviews are retrieved from the datamodel and fed into the draco library here:
https://github.com/syoyo/tinygltf/blob/c201efb9985c89d9d8935a560e0ce92f1acbd165/tiny_gltf.h#L4709

For cgltf, the decoding should look similar.

@guillaumechereau
Copy link

I'd like to comment on that since I am trying to figure out the simplest way to make it work as well. The difficulty is that there is no simple way to add buffers or buffer views to a cgltf_data instance. Using cgltf_buffer_view->data is also not convenient because it would require to use the same buffer data for indices and vertices.

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

5 participants
0