Closed romainguy closed 4 years ago
To be clear, one would have to decompress the actual vertex data after parsing the file with cgltf, correct? If so, should we add a comment about that and maybe a link to the Draco lib?
That is correct, decompression is still up to the client app. Where would you like me to document this?
I forgot to mention that I tested the change with test_write on official gltf samples that use Draco compression.
This all looks good to me except for a few spots where spaces were used instead of tabs :)
Done!
Actually, I think we should have a list of supported extensions at the top of cgltf.h
. We could also mention the Draco limitation there. I'll take care of that after merging.
Thank you!
This change adds support to read and write glTF files that use the
KHR_draco_mesh_compression
extension. The extension can be specified per primitive, which is why cgltf_primitive now has 2 new fields:has_draco_mesh_compression
anddraco_mesh_compression
.draco_mesh_compression
contains a buffer view and a list of attributes.It is important to note that the extension may or may not be required. A primitive can specify both compressed and uncompressed data. While this doesn't affect the parsing, it does affect the writing since the proper extensionsUsed/Required needs to be specified. To achieve this, this change adds support for required extensions in
cgltf_write.h
(seerequired_extensions_flag
incgltf_context
). The extension is deemed required when a primitive has no attributes or no indices.Please refer to the extension spec.