cesium-native icon indicating copy to clipboard operation
cesium-native copied to clipboard

Various glTF fixes, mostly meshopt related

Open kring opened this issue 1 year ago • 0 comments

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::collapseToSingleBuffer now works correctly even if some of the buffers in the model have a uri 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 the EXT_meshopt_compression extension.
  • GltfUtilities::compactBuffer now accounts for bufferViews with the EXT_meshopt_compression when determining unused buffer ranges.
  • When GltfReader decodes buffers with data URLs, and the size of the data in the URL does not match the buffer's byteLength, the byteLength 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 and KHR_mesh_quantization are now removed from extensionsUsed and extensionsRequired after they are decoded by GltfReader.

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.

kring avatar May 06 '24 04:05 kring