Vixen
02b45cc4
csharp
public readonly record struct MeshletBuildSettings

What a cluster-DAG build is being asked for: how big a cluster is, and how many of them are simplified together.

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

Remarks

Two sizes, and they do different jobs. MaxTriangles is the unit of culling and of streaming — every cluster is accepted or rejected whole, so it is the granularity of everything the device does. GroupSize is the unit of simplification, and it is what decides how much of a mesh a level of detail can actually remove: a group's shared boundary is locked, so a group of one cluster can collapse nothing at all and a group of thirty-two collapses almost everything inside it.

The defaults are Nanite's, and they are not arbitrary. 128 triangles is about what a workgroup can hold and about where the per-cluster overhead stops mattering; groups of eight to thirty-two are where the locked boundary is a small fraction of the group's edges. Both are dials rather than constants because the right answer depends on the mesh — a terrain patch and a character do not want the same numbers.

Fields and properties (7)

  • public int MaxTriangles

    The most triangles one cluster may hold.

  • public int MaxVertices

    The most distinct vertices one cluster may reference.

  • public int GroupSize

    How many clusters are simplified together as a group.

  • public float SimplifyRatio

    What fraction of a group's triangles a simplification aims to keep.

  • public int FallbackTriangles

    How many triangles the fallback mesh may have.

  • public int MaxLevels

    How many levels the build may produce before it gives up.

  • public bool Parallel

    Whether groups within a level are simplified in parallel.

Methods (2)

  • public MeshletBuildSettings()

    The defaults: 128-triangle clusters simplified sixteen at a time.

  • public void Validate()

    Refuses settings that cannot produce a DAG.

Used by (7)

  • MeshletBuilderVixen.Rendering.VirtualGeometry
  • MeshletBuilderTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletCutTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletValidatorTestsVixen.Rendering.VirtualGeometry.Tests
  • SessionVixen.Rendering.VirtualGeometry
  • ModelCompilerVixen.Editor.Assets
  • ModelImportSettingsVixen.Editor.Assets