Vixen
dd8b0a81
csharp
public sealed class WorldRenderer

Everything between a world and a drawn frame, assembled.

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

Remarks

The join an application was missing. The scene half was finished — components, extraction systems, a residency cache — and so was the frame half, and nothing put them together: a game had to construct four features, a geometry buffer, a residency, two extraction systems and a host, in an order, and get every reference between them right. The samples opened a device and issued draws instead, which is why none of them is a game.

What it is not is a policy. It creates the standard features and the standard extraction, and it decides nothing about the frame: the compositor comes from a document, the stages come with it, and the content comes from wherever the application mounted it. A project that wants a different set adds to Host and skips Register.

The order it enforces is the one worth enforcing. Extraction runs in SystemPhase.PreRender after the transforms are written, so an object is culled against where it is this frame rather than where it was last one; the compositor then collects the views and runs the render system's own phases. Both of those are decisions somebody has already made correctly, and this is where a second host stops being able to make them again differently.

Fields and properties (40)

  • public const int MeshParticleLayout

    Which entry of this renderer's vertex layout table describes a mesh drawn as particles.

  • public IGraphicsDevice Device

    The device everything here lives on.

  • public SceneRenderHost Host

    The frame: a compositor, a graph and the render system.

  • public DescriptorAllocator MaterialDescriptors

    Where a material's own descriptor set is allocated from, frame by frame.

  • public int UploadedBytes

    How many bytes of geometry have been copied to the device.

  • public SamplerCache Samplers

    The samplers the frame's nodes share.

  • public SceneConstants SceneBlock

    The frame's set 0: the lighting environment every shading pass reads.

  • public SceneLighting SceneEnvironment

    What the scene contributes to it: the sky, the probes, the sun.

  • public EnvironmentTexture? Environment

    The prefiltered sky to copy up before the frame that samples it, or null for a host that uploads its own.

  • public ViewConstants ViewBlock

    The camera's set 1, which fills itself from whichever view is being drawn.

  • public GeometryBuffer Geometry

    The shared vertex and index memory every scene mesh is suballocated from.

  • public GeometryResidency Residency

    What decides which meshes are in it, and shares one slice between every user.

  • public MeshRenderFeature Meshes

    The feature that draws them.

  • public MorphRenderFeature Morphing

    The blend-shape pre-pass, which gives a morphed mesh a vertex buffer of its own.

  • public LodRenderFeature Lods

    Which level of each authored LOD group a view sees, and which it hides.

  • public MaterialRenderFeature Materials

    The materials they are drawn with.

  • public TransformRenderFeature Transforms

    Their world matrices.

  • public MotionVectorRenderFeature Motion

    And where those matrices were last frame, for the velocity pass.

  • public ForwardLightingRenderFeature Lighting

    The lights that reach them.

  • public ParticleRenderFeature Particles

    The feature that draws VfxSystems, for a frame with a stage to put them in.

  • public UiRenderFeature Ui

    The interfaces drawn inside this frame, and where a game mounts its HUD.

  • public MaterialRenderFeature ParticleMaterials

    The materials Particles is drawn with, which are not Materials.

  • public IMeshSource? Source

    Where the geometry a mesh reference names comes from.

  • public IMaterialSource? Painter

    Where the material a reference names comes from.

  • public BindlessTable? Table

    The frame's texture table, on a device that has one.

  • public AssetTextureSource? Painted

    Where a material's textures come from, once content is mounted.

  • public TextureDemand? Demand

    What sizes them, on a renderer whose textures are streamed.

  • public TextureStreamingQuality Textures

    The texture numbers the host's tier resolved to, read by Mount.

  • public ILogger? Logger

    Where the streaming pool's refusals are reported, or null for nobody watching.

  • public VirtualGeometrySystem? Clusters

    The virtualized stack, if this renderer was given one.

  • public IVirtualGeometrySource? Hierarchies

    Where the cluster hierarchy a mesh reference names comes from.

  • public MeshExtractionSystem? Extraction

    The extraction the last Register added, or null.

  • public LodExtractionSystem? LodExtraction

    The LOD producer the last Register added, or null.

  • public TerrainSceneSource TerrainScene

    The frame's terrains, filled by the terrain bridge and read by a !Terrain node.

  • public AssetTerrainSource? Terrains

    Where the terrain a component names comes from. Null until Mount.

  • public TerrainExtractionSystem? TerrainExtraction

    The terrain bridge the last Register added, or null.

  • public VfxExtractionSystem? Emitters

    The emitter bridge the last Register added, or null.

  • public IVfxEffectSource? VfxEffects

    Where the effect a VfxEmitter names comes from.

  • public Material ParticleMaterial

    What every emitter's particles are drawn with.

  • public Material MeshParticleMaterial

    What an effect authored as a mesh renderer is drawn with.

Methods (5)

  • public WorldRenderer(IGraphicsDevice device, EffectSystem effects, int vertexCapacity = 1048576, int indexCapacity = 2097152)

    Builds the standard renderer for a world.

  • public void Mount(AssetManager assets)

    Points the renderer at a content manager, so mesh references resolve.

  • public void Register(EngineLoop loop, RenderStageMask stages, RenderStageMask particleStages = default(RenderStageMask), RenderStageMask staticStages = default(RenderStageMask), RenderStageMask casterStages = default(RenderStageMask))

    Adds the extraction systems to a loop, so the world's entities reach the render system.

  • public void Draw(ICommandList commands)

    Draws the frame, having first put the content work the frame needs on the list.

  • public void Dispose()

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

Used by (23)

  • ArenaThirdPersonShooter
  • ArenaIlluminationThirdPersonShooter
  • PbrShowcaseGamePbrShowcase
  • AppGraphicsVixen.App.Hosting
  • InterfaceInAWorldTestsVixen.Engine.Renderer.Tests
  • LodExtractionTestsVixen.Engine.Renderer.Tests
  • MaterialPairingInventoryTestsVixen.Engine.Renderer.Tests
  • MaterialPermutationInventoryTestsVixen.Engine.Renderer.Tests
  • SettlingVixen.Engine.Renderer.Tests
  • StandardFrameTierImageTestsVixen.Graphics.Golden.Tests
  • StreamingOverlayVixen.Engine.Renderer
  • TextureDemandTestsVixen.Engine.Renderer.Tests
  • TierSceneVixen.Graphics.Golden.Tests
  • WorldRendererTestsVixen.Engine.Renderer.Tests
  • ComposedPaneTestsVixen.Editor.App.Tests
  • EditorMountTestsVixen.Editor.App.Tests
  • EditorWorldRendererVixen.Editor.App
  • EditorWorldRendererTestsVixen.Editor.App.Tests
  • FramePresenterVixen.Editor.App
  • FramePresenterTestsVixen.Editor.App.Tests
  • HostedOverlayTestsVixen.App.Tests
  • HostedRendererTestsVixen.App.Tests
  • LayeredGameVixen.App.Tests