Closed kring closed 1 month ago
I've addressed @lilleyse's comment and added tests, so this is now ready to review and merge.
The macOS runners are taking a while to launch. But everything else passed and the code looks good to me, so I'm going to merge.
EXT_meshopt_compression
is fun because it is, as far as I'm aware, the only thing other than a regularbufferView
that can reference abuffer
. This wasn't being accounted for in a lot of the glTF manipulation code.From the changelog:
Model::merge
. Previously these extensions could end up broken after merging.EXT_meshopt_compression
GltfUtilities::collapseToSingleBuffer
now works correctly even if some of the buffers in the model have auri
property and the data at that URI has not yet been loaded. Such buffers are left unmodified.GltfUtilities::collapseToSingleBuffer
now works correctly with bufferViews that have theEXT_meshopt_compression
extension.GltfUtilities::compactBuffer
now accounts for bufferViews with theEXT_meshopt_compression
when determining unused buffer ranges.GltfReader
decodes buffers with data URLs, and the size of the data in the URL does not match the buffer'sbyteLength
, thebyteLength
is now updated and a warning is raised. Previously, the mismatch was ignored and would cause problems later when trying to use these buffers.EXT_meshopt_compression
andKHR_mesh_quantization
are now removed fromextensionsUsed
andextensionsRequired
after they are decoded byGltfReader
.Draft because I need to write tests for a lot of this, though I have empirical evidence in another project that these changes are necessary and that they are working well.