Expand description
LOD chain (P5.8): author mesh → decimate N LODs → serialize to .10d →
renderer parses each level → plan_view selects the expected LOD. Gated
like the scientific geometry stack (needs crate::specialized_libs).
P5.8 — LOD chain: author mesh → decimate N LODs → serialize to .10d
→ renderer parses each level → plan_view selects the expected LOD.
This module is the serial integrator spine connecting P5.7 (decimate_3)
to the .10d container format and the authoring planner (authoring.rs).
§Pipeline
- Author: a source
Mesh(the highest-LOD asset). - Decimate: produce N LOD levels by successive QEM decimation, each targeting a fraction of the previous level’s triangle count.
- Serialize: encode each LOD as a
.10dQuantizedMesh section (mesh_section.rs), concatenated into a single buffer. - Select: at render time,
select_lodpicks the appropriate LOD index based onOperationalMode(Full → LOD 0, Eco → LOD 1, Reserve → LOD 2). - Parse: the renderer decodes the selected section back to a
Mesh.
§Determinism
Decimation is deterministic (canonical vertex remap, sorted collapses).
.10d encoding is deterministic (quantization is pure, section order is
ascending). Two encodes of the same LOD chain produce byte-identical output.
§Budget rail
The plan_view integration adds a LodDisposition that combines the
existing governance/attestation gates with LOD selection. On a constrained
tier (Eco/Reserve), a Scene3D view selects a coarser LOD rather than
collapsing to 2D — if a coarser LOD is available. If no coarser LOD
exists, the existing Collapsed2D fallback applies.
Structs§
- LodChain
Options - LOD chain configuration: how many levels and what fraction to decimate to at each level.
- LodChain
Report - Overall LOD chain build report.
- LodLevel
Report - Report for one LOD level after building the chain.
Enums§
- LodChain
Error - Failure modes for the LOD chain.
- LodView
Disposition - The LOD-aware disposition for a view, extending
ViewDispositionwith LOD selection for 3D scenes that have a LOD chain available.
Constants§
- MAX_
LOD_ LEVELS - Maximum number of LOD levels supported (including LOD 0 = full resolution).
Functions§
- build_
lod_ chain - Build a LOD chain from a source mesh and serialize all levels as
.10dQuantizedMesh sections intoout_buffer. - level_
offsets - Extract the per-level byte offsets from a
LodChainReport. - lod_
chain_ hash - Compute a simple FNV-1a hash over a byte slice (for determinism verification).
- parse_
lod_ level - Parse a specific LOD level from a serialized LOD chain buffer.
- plan_
view_ with_ lod - Plan a view with LOD awareness. Applies the same gate order as
authoring::plan_view(attestation → rights → budget), but instead of collapsing 3D to 2D on constrained tiers, selects a coarser LOD if available. - required_
lod_ buffer_ size - Compute the total buffer size needed for a LOD chain with the given options and source mesh size. This is an upper bound (actual may be smaller if decimation stops early).
- select_
lod - Select the appropriate LOD index for a given
OperationalMode.