Expand description
Mesh chunk version 2 (SPEC.md, sections 6.6 to 6.9): the same mesh as
version 1, kept as exactly, in fewer bytes.
Triangles go in their own order (connectivity A) or in the order the triangle codec compresses best, with the way back (connectivity B). Vertices go through meshoptimizer’s vertex codec, or are predicted from the triangles around them and only the difference is stored: entropy-coded with rANS, or as byte planes for the chunk’s zstd.
metadata as in version 1
counts u32 vertices, u32 triangles
codings u8 connectivity (0 A, 1 B), u8 vertex coding
(0 meshopt, 1 predicted + rANS, 2 predicted + planes)
parts u32 length + bytes each:
A: index buffer, corners
B: index buffer, permutation, corners
then meshopt: vertex buffer; rANS: tables, stream, raw
bits; planes: 12 byte planesStructs§
- Mesh
Coding - The codings a version 2 mesh payload uses.
Enums§
- Connectivity
- How a version 2 mesh stores its triangles.
- Vertex
Coding - How a version 2 mesh stores its vertices.
Functions§
- decode_
mesh_ v2 - Decodes a mesh chunk payload of version 2.
- encode_
mesh_ v2 - Encodes
meshas a mesh chunk payload of version 2, choosing the codings that store it smallest. - encode_
mesh_ v2_ with - Encodes
meshas a mesh chunk payload of version 2 with the given codings.