Vixen
02b45cc4
csharp
public sealed class VirtualGeometrySystem

Every device-side piece of virtualized geometry, joined up.

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

Remarks

The assembly nobody had written. Six objects have to point at each other before a cluster reaches a pixel — the traversal, the page pool and its residency, the raster, the binning and the resolve — and every one of them was independently constructible and independently tested. What was missing is the only part with no natural owner: which of them holds which, and in what order they are told about a frame. A host doing it by hand gets it right the first time and wrong on the second project.

It owns the device objects and not the scene. What goes in is a device, an effect system and a budget; what comes out is a feature to register with a RenderSystem and six references a CompositorBuilder wants. It has no opinion about which objects draw, which is Draws' business, or where in the frame the passes go, which is a document's.

One page pool for the scene, and that is the whole of the streaming budget. Slots times page size is the resident geometry a project has decided to pay for, and every mesh registered through Content shares it — which is what makes a hundred virtualized meshes cost one budget rather than a hundred.

Fields and properties (16)

Methods (6)

  • public VirtualGeometrySystem(IGraphicsDevice device, int slots = 512, int pageSize = 131072)

    Builds the stack on a device.

  • public int Content(int id, ReadOnlySpan<byte> hierarchy, ReadOnlySpan<byte> pages, Stream data)

    Loads a mesh out of the artefacts a build wrote, and makes it drawable.

  • public int Content(int id, VirtualGeometryAsset asset, Stream data)

    Loads a mesh out of the one chunk a build writes the records as.

  • public void Register(RenderSystem system)

    Registers the feature with a render system.

  • public void Supply(CompositorBuilder builder)

    Hands a compositor builder everything its two nodes need.

  • public void Dispose()

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

Used by (9)

  • ArenaThirdPersonShooter
  • VirtualGeometryGameVirtualGeometry
  • AssetVirtualGeometrySourceVixen.Engine.Renderer
  • SceneRenderHostTestsVixen.Engine.Renderer.Tests
  • VirtualGeometryContentTestsVixen.Rendering.Tests
  • VirtualGeometryDeviceTestsVixen.Graphics.Golden.Tests
  • VirtualGeometryGoldenTestsVixen.Graphics.Golden.Tests
  • WorldRendererVixen.Engine.Renderer
  • ImportedGeometryLoadsTestsVixen.Editor.Assets.Tests