Vixen
02b45cc4
csharp
public readonly record struct Meshlet

One cluster: about a hundred and twenty-eight triangles, culled and streamed as a unit.

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

Remarks

A range rather than its own arrays. The triangles of every cluster at every level live in one pair of arrays on MeshletMesh, because the thing that consumes them is a page pool with one buffer per vertex layout — and a cluster that owned its arrays would be a thousand allocations per mesh describing what two offsets describe.

Error and ParentError are what make a cut crack-free. A cluster is drawn when its own error is under the threshold and its parent's is not — Error ≤ t < ParentError — which is a decision each cluster takes alone, with no knowledge of what its neighbours decided. That only works because the build guarantees a parent's error is at least every child's: two clusters either side of a group boundary cross the threshold at the same value, so a cut never takes the parent on one side and the child on the other.

Both are object-space lengths, not pixels. The projection is the runtime's, because it depends on the view — see PixelError, which is the arithmetic a traversal shader will mirror.

Fields and properties (15)

  • public int VertexOffset

    Where this cluster's entries start in Vertices.

  • public int VertexCount

    How many distinct vertices it references.

  • public int TriangleOffset

    Which triangle of Triangles is its first.

  • public int TriangleCount

    How many triangles it holds.

  • public BoundingBox Bounds

    Everything it occupies, in the mesh's own space.

  • public Vector3 ConeAxis

    The axis of the cone every triangle's normal lies inside.

  • public float ConeCosine

    The cosine of the cone's half-angle.

  • public float Error

    How far this cluster's surface may deviate from the original mesh, in object space.

  • public float ParentError

    The error of the group this cluster is simplified into, or infinity for a root.

  • public int Level

    How many simplifications lie between this cluster and the original mesh.

  • public int Group

    The group this cluster is a member of — the one that simplified it away — or −1.

  • public int Source

    The group whose simplification produced this cluster, or −1 at level zero.

  • public int MaterialIndex

    Which of the model's materials it is drawn with.

  • public int FirstBone

    The lowest bone index any of its vertices is weighted to, or −1 if it is not skinned.

  • public int BoneCount

    How many consecutive bones the range covers, or zero if it is not skinned.

Methods (1)

  • public Meshlet()

    An empty cluster, for the serializer.

Used by (18)

  • ClusterRasterTestsVixen.Rendering.Tests
  • GpuClusterCullingVixen.Rendering
  • GpuClusterVisibilityVixen.Rendering
  • MeshletBuilderTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletCutVixen.Rendering.VirtualGeometry
  • MeshletCutTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletMeshVixen.Rendering.VirtualGeometry
  • MeshletPageBuilderVixen.Rendering.VirtualGeometry
  • MeshletPageBuilderTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletValidatorVixen.Rendering.VirtualGeometry
  • MeshletValidatorTestsVixen.Rendering.VirtualGeometry.Tests
  • SessionVixen.Rendering.VirtualGeometry
  • SkinnedClusterTestsVixen.Rendering.Tests
  • SoftwareRasterTestsVixen.Rendering.Tests
  • Vixen_Rendering_VirtualGeometry_MeshletMeshSerializerVixen.Rendering.VirtualGeometry
  • Vixen_Rendering_VirtualGeometry_MeshletSerializerVixen.Rendering.VirtualGeometry
  • ModelImporterTestsVixen.Editor.Assets.Tests
  • SkinnedPageTestsVixen.Editor.Assets.Tests