Skip to content

Comments

Compress meshlet data using new meshletcodec#54

Merged
zeux merged 3 commits intomasterfrom
mlc
Feb 6, 2026
Merged

Compress meshlet data using new meshletcodec#54
zeux merged 3 commits intomasterfrom
mlc

Conversation

@zeux
Copy link
Owner

@zeux zeux commented Feb 5, 2026

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)

zeux added 3 commits February 5, 2026 14:08
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.
@zeux zeux merged commit 8700471 into master Feb 6, 2026
2 checks passed
@zeux zeux deleted the mlc branch February 13, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant