-
I have an uncompressed gltf loaded into CPP as various buffers and I would like to compress it using meshopt before writing. gltfpack does the compression that I want to however I need to write the buffers to memory before using it. Is there any way to import gltfpack as a library so I can use its functions without having to rewrite every function from scratch? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Buffer compression can be accessed via meshoptimizer library; documented here https://github.com/zeux/meshoptimizer?tab=readme-ov-file#vertexindex-buffer-compression except for filters that can be accessed via encoders in meshoptimizer (https://github.com/zeux/meshoptimizer/blob/master/src/meshoptimizer.h#L298-L326). Note that gltfpack currently doesn't use the encoder functions, as they were added after the gltfpack implementation but it's the same algorithms more or less, I just haven't gotten around to replacing the code in gltfpack to use the meshoptimizer functions directly. For various other processing functions gltfpack mostly relies on meshoptimizer where possible; of course various glTF scene optimizations require access to the full document represented via cgltf in memory. There are no plans to make these accessible as a library as this is specific to the glTF library used and details there change over time. |
Beta Was this translation helpful? Give feedback.
Buffer compression can be accessed via meshoptimizer library; documented here https://github.com/zeux/meshoptimizer?tab=readme-ov-file#vertexindex-buffer-compression except for filters that can be accessed via encoders in meshoptimizer (https://github.com/zeux/meshoptimizer/blob/master/src/meshoptimizer.h#L298-L326). Note that gltfpack currently doesn't use the encoder functions, as they were added after the gltfpack implementation but it's the same algorithms more or less, I just haven't gotten around to replacing the code in gltfpack to use the meshoptimizer functions directly.
For various other processing functions gltfpack mostly relies on meshoptimizer where possible; of course vario…