Skip to main content

Module cluster_dag_section

Module cluster_dag_section 

Source
Expand description

Section 23 (CDAG): Nanite-Style Hierarchical Meshlet Cluster DAG Section.

Encodes a continuous level-of-detail (CLOD) directed acyclic graph of 64-byte cache-line-aligned meshlet clusters (MeshletClusterNode) preceded by a 32-byte header (ClusterDagMiniHeader).

Each cluster stores its own bounding sphere and quadric error (lod_error_self) alongside its parent group’s bounding sphere and error (lod_error_parent), satisfying the monotonic DAG cut invariant lod_error_parent >= lod_error_self. At runtime, GPU compute or CPU zero-heap traversal selects the cut where: projected_error(self) <= threshold_px < projected_error(parent).

Structs§

ClusterDagMiniHeader
32-byte POD mini-header for SectionType::ClusterDag (CDAG).
MeshletClusterNode
64-byte cache-line-aligned POD node representing one meshlet in the Cluster DAG.

Enums§

ClusterDagSectionError
Errors emitted by the CDAG section codec and zero-heap LOD cut selector.

Constants§

CLUSTER_DAG_HEADER_SIZE
Fixed byte size of ClusterDagMiniHeader.
CLUSTER_DAG_SECTION_VERSION
Current format version of the CDAG section.
FLAG_CDAG_CONE_CULLED
Normal cone axis and cutoff are populated for backface cluster culling.
FLAG_CDAG_SEAM_LOCKED
Cluster border vertices were seam-locked during hierarchical QEM simplification.
MAGIC_CDAG
4-byte ASCII magic for .10d Cluster DAG sections ("CDAG").
MAX_CLUSTER_DAG_NODES
Maximum cluster nodes admitted in a single CDAG section.
MAX_MESHLET_TRIANGLES
Maximum triangles allowed in a single hardware meshlet cluster.
MAX_MESHLET_VERTICES
Maximum vertices allowed in a single hardware meshlet cluster.
MESHLET_CLUSTER_NODE_SIZE
Fixed byte size of MeshletClusterNode.

Functions§

cluster_dag_encoded_len
Compute exact byte length for a CDAG section with cluster_count nodes.
decode_cluster_dag_section
Decode and validate a CDAG section into caller-provided MeshletClusterNode storage (Zero-Heap).
decode_oct16_normal
Decode [i16; 2] octahedral snorm16 coordinates back into a unit 3D vector.
encode_cluster_dag_section
Encode a CDAG section into a caller-provided byte slice without heap allocation.
encode_oct16_normal
Encode a unit 3D direction into [i16; 2] octahedral snorm16 coordinates.
project_sphere_error_px
Project a world-space geometric error world_error at sphere into screen-space pixels.
select_cut_clusters_zero_heap
Select the active continuous-LOD cut into out_cluster_indices without heap allocation.