Conversation
We need a post-1.0 version to be able to integrate meshletcodec.
Similarly to vertex/index buffer, we can now compress the meshlet data in scene cache using meshlet codec. It results in 2.5-3x compression depending on the file and decompresses at 8-9 GB/s, well above vertex or index codecs. It needs external framing to encode the size; we actually have space in the headers but we might need to compact them in the future so for now encode the 2-byte header with each meshlet.
With the compressed meshlet data, meshlet headers are now a little too large. This change shrinks them from 32 bytes to 24 by switching to half floats for the bounding sphere. Since vertex data is using half floats, it should be sufficient here as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change integrates new meshletcodec from meshoptimizer to compress meshlet data, resulting in 2.5-3x compression depending on the file. It decompresses at 8-9 GB/s, well above vertex or index codecs.
Since meshlet headers were starting to look a little too large in relation to the meshlet data, this also converts the bounding sphere to use float16 - since we now use halfs to store vertex positions, they should be sufficient here too. (ideally the bounding sphere radius may need to be adjusted upwards to stay conservative but this is probably good enough as is)
bistro.gltf+bin: 100.4 MB
bistro.gltf.cache, uncompressed: ~111 MB (38.1 MB zstd)
bistro.gltf.cache, before: 51.9 MB (27.7 MB zstd)
bistro.gltf.cache, after: 38.2 MB (23.5 MB zstd)
(this is too simple to do on stream and doesn't naturally fold into any upcoming topics so I figured I could just do this offline and submit a PR)