Vixen
02b45cc4
csharp
public static class MeshletBuilder

Turns a mesh into a cluster DAG: every level of detail at once, and no cracks between them.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Phase 1 of docs/plan/22-virtualized-geometry.md, and the phase that decides whether the result has cracks. The loop is four steps and the third is the whole trick:

Cluster the triangles into groups of about MaxTriangles by an edge-cut partition of the triangle adjacency graph, so a cluster is a patch of surface rather than a run of the index buffer. Group neighbouring clusters, about GroupSize of them, by the same partition one level up. Simplify the group as a unit with its shared outer boundary locked — which lets every edge interior to the group collapse, including the edges between its clusters, while guaranteeing that any cut through the finished DAG meets along edges that were never moved. Split the simplified result back into clusters, and repeat.

Locking the group's boundary rather than each cluster's is what makes the hierarchy coarsen. Every edge between two clusters of a group is some cluster's boundary, so the per-cluster lock — which is the obvious reading — leaves only cluster interiors to collapse: a level then reaches about a third off rather than the half it asked for, and the DAG needs more levels and carries more error at every one of them. It is not a crack, because locking more than necessary never is. It is measured in MeshletValidatorTests as the quality failure it actually is.

Nothing here is heuristic about correctness. The error metric may be pessimistic and the partition may be a few edges off optimal; what may not happen is a parent whose error is not strictly above every child's, or a group boundary that moved. Both are checked by MeshletValidator against the finished DAG rather than trusted from here.

Methods (1)

Used by (18)

  • VirtualGeometryGameVirtualGeometry
  • ClusterRasterTestsVixen.Rendering.Tests
  • ClusterResolveTestsVixen.Rendering.Tests
  • ClusterTraversalAcceptsTestsVixen.Rendering.Tests
  • ClusterTraversalGroupTestsVixen.Rendering.Tests
  • MeshletBuilderTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletCutTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletPageBuilderTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletStreamingTestsVixen.Rendering.Tests
  • MeshletValidatorTestsVixen.Rendering.VirtualGeometry.Tests
  • SkinnedClusterTestsVixen.Rendering.Tests
  • SoftwareRasterTestsVixen.Rendering.Tests
  • VirtualGeometryContentTestsVixen.Rendering.Tests
  • VirtualGeometryDeviceTestsVixen.Graphics.Golden.Tests
  • VirtualGeometryFrameTestsVixen.Rendering.Tests
  • VirtualGeometryGoldenTestsVixen.Graphics.Golden.Tests
  • VisibilityResolveTestsVixen.Rendering.Tests
  • ModelCompilerVixen.Editor.Assets