Vixen
02b45cc4
csharp
public sealed class AssetVirtualGeometrySource

The cluster hierarchy a scene's mesh references name, loaded and registered.

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

Remarks

The extraction counterpart VirtualGeometrySystem was missing. Every phase of the virtualized path was finished — the import cuts a mesh into clusters, the traversal walks the DAG, the raster fills a visibility buffer and the resolve shades it — and nothing looked at whether a model had a hierarchy, so the whole system was reachable from code and not from a scene.

It asks the mesh where its clusters are. A sub-asset's id is derived from the importer's name, the kind and the mesh's name, and a frame holding a mesh reference knows none of them — so Clusters is the link and this follows it. That also makes "does this mesh have clusters" a property of the content rather than a guess, which is what lets a project turn the virtualized path off per mesh at import.

⚠ The MeshData is loaded either way, and for a clustered mesh that means its fallback geometry is in memory and never uploaded. That is not waste worth removing: the fallback is what WebGL2 draws, what the physics cook reads and what a ray query hits, so a project that has it resident is a project that can answer those questions.

Fields and properties (2)

  • public int Requested

    How many distinct meshes have been asked about.

  • public int Registered

    How many turned out to have a hierarchy and were registered.

Methods (3)

  • public AssetVirtualGeometrySource(AssetManager assets, VirtualGeometrySystem geometry)

    Builds a source over a content manager and the stack that draws what it loads.

  • public ClusterState TryGet(AssetReference reference, out int mesh, out BoundingSphere bounds)

    The registration a reference names, if it has clusters and they are here.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (1)

  • WorldRendererVixen.Engine.Renderer