Expand description
Versioned .10d material and submesh sidecar.
MAT4 stores the MAT3 material contract plus an explicit foliage-wind flag; readers remain compatible with MAT1, MAT2 and MAT3. Texture payloads remain in HMC/asset dependencies. Materials and submesh ranges are cold-path data encoded with caller buffers and bounded counts.
Structs§
- Material
Record - Stable, renderer-independent material record. Colours are linear; each texture field is a SHA-256 HMC/resource digest, or all-zero when that slot is unbound.
- Submesh
Range - A contiguous triangle-index interval bound to one stable material identity.
- Texture
Sampler - Per-map sampler state. Defaults follow glTF: repeat, linear magnification and trilinear minification.
- Texture
Transform - glTF-compatible UV transform.
tex_coordselects the source vertex set; current runtime supports set zero and rejects other sets until their vertex streams are present end-to-end.
Enums§
- Material
Section Error - Opacity
Mode - How alpha affects coverage and blending.
- Shading
Model - Material shading model. Stylized shading uses the same material and resource contract.
- Texture
Address Mode - glTF-compatible texture address mode.
- Texture
Filter Mode - Magnification filter. glTF permits nearest or linear.
- Texture
MinFilter - Minification filter including its mip selection policy.
Constants§
- MATERIAL_
RECORD_ SIZE - MATERIAL_
SECTION_ HEADER_ SIZE - MATERIAL_
SECTION_ VERSION - MATERIAL_
V1_ RECORD_ SIZE - MAX_
EMISSIVE_ FACTOR - MAX_
MATERIALS - MAX_
SUBMESH_ RANGES - PREVIOUS_
MATERIAL_ RECORD_ SIZE - SUBMESH_
RANGE_ SIZE - TEXTURE_
SAMPLER_ RECORD_ SIZE
Functions§
- decode_
material_ section_ into - Decode MAT1 through MAT4 into caller-owned arrays. Both outputs must fit the encoded counts.
- encode_
material_ section - Write the current canonical MAT4 section into a caller-owned output buffer.
- encoded_
len - Exact encoded size.
Nonemeans an invalid count or arithmetic overflow. - material_
section_ counts - Inspect validated MAT1–MAT4 layout/counts without allocating output records.
- validate_
material_ bindings - Validate material/range arrays with the exact rules used by MAT4 encoding.