Skip to content

meshletutils: Add optimizeMeshletLevel for improved compression#1031

Merged
zeux merged 3 commits intomasterfrom
ml-optex
Mar 21, 2026
Merged

meshletutils: Add optimizeMeshletLevel for improved compression#1031
zeux merged 3 commits intomasterfrom
ml-optex

Conversation

@zeux
Copy link
Owner

@zeux zeux commented Mar 20, 2026

optimizeMeshlet uses a basic scoring metric for number of vertices in the
cache window; it works reasonably well, but when using meshlet compression,
the compression ratio could be improved further by producing longer strips.
That requires prioritizing matches by cache recency and triangles with low
minimum valence so that we visit dead-ends earlier.

This also reduces the efficiency of match>=2 early out: we need to examine
a few edge matches to pick the best one. To address this tradeoff, we now
allow specifying the level of optimization. At level 0, we use the old
heuristic which is a little cheaper to compute. At level 1+, we use the new
heuristic and early out after encountering level matches; in practice, level
3 or 4 results in maximum compression ratio, but level 1 or 2 are still
useful to reduce the optimization cost at a more marginal benefit.

image

This contribution is sponsored by Valve.

zeux added 3 commits March 20, 2026 12:52
optimizeMeshlet uses a basic scoring metric for number of vertices in the
cache window; it works reasonably well, but when using meshlet compression,
the compression ratio could be improved further by producing longer strips.
That requires prioritizing matches by cache recency and triangles with low
minimum valence so that we visit dead-ends earlier.

This also reduces the efficiency of match>=2 early out: we need to examine
a few edge matches to pick the best one. To address this tradeoff, we now
allow specifying the level of optimization. At level 0, we use the old
heuristic which is a little cheaper to compute. At level 1+, we use the new
heuristic and early out after encountering level matches; in practice, level
3 or 4 results in maximum compression ratio, but level 1 or 2 are still
useful to reduce the optimization cost at a more marginal benefit.
This improves the compression ratio by ~1 bit/triangle depending on the mesh.
Note that optimizeMeshletLevel can be used for further compression gains; also
add it to the experimental function list.
@zeux zeux merged commit c6424a8 into master Mar 21, 2026
13 checks passed
@zeux zeux deleted the ml-optex branch March 21, 2026 17:25
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