public static class ModelCompilerThe decisions about a model that need the whole model, taken once, at build time.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Doc 08's ModelCompiler. It exists because a mesh cannot answer any of these questions about itself: what the vertex layout should be, how the indices should be ordered for the cache, which levels of detail there should be, and — first of them, and what is built here — what the cluster DAG is.
Meshlet generation is phase 1 of docs/plan/22-virtualized-geometry.md, and the whole of the algorithm lives in Vixen.Rendering.VirtualGeometry rather than here, for the reason the distance-field bake lives in Vixen.Rendering.DistanceFields: a MeshletMesh is what this writes and what a player deserialises, so both halves have to be talking about one type — and the algorithm is then testable against spheres and grids with no import context anywhere near it.
What this adds is the refusal. Improvement 5 of the plan: DAG validity is a build error rather than a property the builder is careful about. A mesh whose DAG does not validate produces no meshlets and a message naming the group, because the alternative is an asset that ships and cracks at one distance on one mesh — and nothing about that failure points back at the build that caused it.
Fields and properties (3)
public const int PageAttributeStrideHow many bytes of attributes a page vertex carries beside its quantized position.
public const int SkinnedPageAttributeStrideThe same, for a skinned mesh: eight more bytes of bone influences after the coordinate.
public const int PageInfluenceOffsetWhere a skinned page vertex's influences begin, in bytes from the vertex.
Methods (2)
public static MeshletMesh? CompileMeshlets(MeshData mesh, MeshletBuildSettings settings, Action<ImportSeverity, string> report)Builds one mesh's cluster DAG, or refuses it.
public static MeshletPageSet? CompilePages(MeshData mesh, MeshletMesh meshlets, Action<ImportSeverity, string> report)Packs a DAG's geometry into pages, quantized against one grid.
Used by (3)
- ModelImporterVixen.Editor.Assets
- ModelImporterTestsVixen.Editor.Assets.Tests
- SkinnedPageTestsVixen.Editor.Assets.Tests