public sealed class WorldRendererEverything 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 (28)
public IGraphicsDevice DeviceThe device everything here lives on.
public SceneRenderHost HostThe frame: a compositor, a graph and the render system.
public DescriptorAllocator MaterialDescriptorsWhere a material's own descriptor set is allocated from, frame by frame.
public int UploadedBytesHow many bytes of geometry have been copied to the device.
public SamplerCache SamplersThe samplers the frame's nodes share.
public SceneConstants SceneBlockThe frame's set 0: the lighting environment every shading pass reads.
public SceneLighting SceneEnvironmentWhat the scene contributes to it: the sky, the probes, the sun.
public EnvironmentTexture? EnvironmentThe prefiltered sky to copy up before the frame that samples it, or null for a host that uploads its own.
public ViewConstants ViewBlockThe camera's set 1, which fills itself from whichever view is being drawn.
public GeometryBuffer GeometryThe shared vertex and index memory every scene mesh is suballocated from.
public GeometryResidency ResidencyWhat decides which meshes are in it, and shares one slice between every user.
public MeshRenderFeature MeshesThe feature that draws them.
public MaterialRenderFeature MaterialsThe materials they are drawn with.
public TransformRenderFeature TransformsTheir world matrices.
public MotionVectorRenderFeature MotionAnd where those matrices were last frame, for the velocity pass.
public ForwardLightingRenderFeature LightingThe lights that reach them.
public ParticleRenderFeature ParticlesThe feature that draws VfxSystems, for a frame with a stage to put them in.
public MaterialRenderFeature ParticleMaterialsThe materials Particles is drawn with, which are not Materials.
public IMeshSource? SourceWhere the geometry a mesh reference names comes from.
public IMaterialSource? PainterWhere the material a reference names comes from.
public BindlessTable? TableThe frame's texture table, on a device that has one.
public AssetTextureSource? PaintedWhere a material's textures come from, once content is mounted.
public VirtualGeometrySystem? ClustersThe virtualized stack, if this renderer was given one.
public IVirtualGeometrySource? HierarchiesWhere the cluster hierarchy a mesh reference names comes from.
public MeshExtractionSystem? ExtractionThe extraction the last Register added, or null.
public VfxExtractionSystem? EmittersThe emitter bridge the last Register added, or null.
public IVfxEffectSource? VfxEffectsWhere the effect a VfxEmitter names comes from.
public Material ParticleMaterialWhat every emitter's particles are 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))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 (5)
- ArenaThirdPersonShooter
- ArenaIlluminationThirdPersonShooter
- AppGraphicsVixen.App.Hosting
- WorldRendererTestsVixen.Engine.Renderer.Tests
- HostedRendererTestsVixen.App.Tests