cesium-native
cesium-native copied to clipboard
Various glTF fixes, mostly meshopt related
EXT_meshopt_compression is fun because it is, as far as I'm aware, the only thing other than a regular bufferView that can reference a buffer. This wasn't being accounted for in a lot of the glTF manipulation code.
From the changelog:
- Added support for the following glTF extensions to
Model::merge. Previously these extensions could end up broken after merging.- ...
-
EXT_meshopt_compression
-
GltfUtilities::collapseToSingleBuffernow works correctly even if some of the buffers in the model have auriproperty and the data at that URI has not yet been loaded. Such buffers are left unmodified. -
GltfUtilities::collapseToSingleBuffernow works correctly with bufferViews that have theEXT_meshopt_compressionextension. -
GltfUtilities::compactBuffernow accounts for bufferViews with theEXT_meshopt_compressionwhen determining unused buffer ranges. - When
GltfReaderdecodes buffers with data URLs, and the size of the data in the URL does not match the buffer'sbyteLength, thebyteLengthis 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_compressionandKHR_mesh_quantizationare now removed fromextensionsUsedandextensionsRequiredafter 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.