Vixen
02b45cc4
csharp
public record class MeshletPageSet

A cluster DAG packed into pages: the runtime form of MeshletMesh.

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

Remarks

Phase 2 of docs/plan/22-virtualized-geometry.md, the offline half. What phase 1 produced is a DAG whose clusters index one mesh-wide vertex array — relocatable, but not streamable: nothing in it can be loaded without loading all of it. This is the same DAG with its geometry cut into fixed-size pages that can be.

The records stay resident and only the geometry streams. Meshlets is the hierarchy — bounds, cones, errors, the group links — and a traversal has to walk it to find out which clusters it wants, so it cannot itself be paged. It is also small: sixty-odd bytes against a cluster's two kilobytes of geometry, which is the ratio that makes the split obviously right rather than a compromise.

Page zero holds the roots and is pinned. That is what makes a never-streamed object draw: an object whose pages have not arrived, or whose budget will not stretch to them, is drawn at its coarsest level rather than not at all. It is also what makes streaming degrade rather than fail — see MeshletCut.SelectByError's residency-aware overload.

Fields and properties (12)

  • public MeshletPage[] Pages

    The pages, coarsest first.

  • public MeshletPageCluster[] Clusters

    Where each cluster's geometry is, indexed as Meshlets is.

  • public byte[] Data

    Every page's bytes, concatenated. One page is PageSize bytes of it.

  • public int PageSize

    How many bytes one page occupies in the pool.

  • public int VertexStride

    How many bytes one page vertex occupies: six of position, then the attributes.

  • public int InfluenceOffset

    Where a vertex's four bone influences start, in bytes from the vertex, or −1 for a mesh that has none.

  • public bool IsSkinned

    Whether the vertices carry bone influences.

  • public Vector3 QuantizationOrigin

    The corner of the mesh-wide quantization grid.

  • public float QuantizationStep

    How far apart the grid's points are, in object space.

  • public float QuantizationError

    The most a vertex can have moved by being quantized: half a step, in object space.

  • public long TotalBytes

    How many bytes the pages occupy in total.

  • public bool HasData

    Whether the geometry is here, as opposed to in a blob beside it.

Methods (6)

  • public MeshletPageSet WithoutData()

    The same set with the geometry removed, for a build that ships the bytes separately.

  • public long OffsetOf(int page)

    Where a page's bytes start in the blob, whether or not the blob is here.

  • public ReadOnlySpan<byte> BytesOf(int page)

    The bytes of one page, ready to be handed to a pool.

  • public void GetPositions(int cluster, int vertexCount, Span<Vector3> positions)

    One cluster's positions, decoded back to object space.

  • public void GetInfluences(int cluster, int vertexCount, Span<VertexInfluence> influences)

    One cluster's bone influences, decoded.

  • public ReadOnlySpan<byte> GetCorners(int cluster, int triangleCount)

    One cluster's triangle corners, as indices into its own vertex list.

Used by (33)

  • VirtualGeometryGameVirtualGeometry
  • BlobVixen.Rendering
  • ClusterRasterTestsVixen.Rendering.Tests
  • ClusterResolveTestsVixen.Rendering.Tests
  • ClusterTraversalAcceptsTestsVixen.Rendering.Tests
  • ClusterTraversalGroupTestsVixen.Rendering.Tests
  • DelayedSourceVixen.Rendering.Tests
  • GeometryVixen.Graphics.Golden.Tests
  • GpuClusterCullingVixen.Rendering
  • GpuClusterVisibilityVixen.Rendering
  • MemoryMeshletPageSourceVixen.Rendering
  • MeshletCutVixen.Rendering.VirtualGeometry
  • MeshletPageBuilderVixen.Rendering.VirtualGeometry
  • MeshletPageBuilderTestsVixen.Rendering.VirtualGeometry.Tests
  • MeshletStreamingTestsVixen.Rendering.Tests
  • SkinnedClusterTestsVixen.Rendering.Tests
  • StreamMeshletPageSourceVixen.Rendering
  • TypeRegistrationVixen.Rendering
  • VirtualGeometryAssetVixen.Rendering
  • VirtualGeometryContentVixen.Rendering
  • VirtualGeometryContentTestsVixen.Rendering.Tests
  • VirtualGeometryDeviceTestsVixen.Graphics.Golden.Tests
  • VirtualGeometryFrameTestsVixen.Rendering.Tests
  • VirtualGeometryGoldenTestsVixen.Graphics.Golden.Tests
  • VirtualGeometryRenderFeatureVixen.Rendering
  • VisibilityResolveTestsVixen.Rendering.Tests
  • Vixen_Rendering_VirtualGeometryAssetSerializerVixen.Rendering
  • Vixen_Rendering_VirtualGeometry_MeshletPageSetSerializerVixen.Rendering.VirtualGeometry
  • ImportedGeometryLoadsTestsVixen.Editor.Assets.Tests
  • ModelCompilerVixen.Editor.Assets
  • ModelImporterVixen.Editor.Assets
  • ModelImporterTestsVixen.Editor.Assets.Tests
  • SkinnedPageTestsVixen.Editor.Assets.Tests