public sealed class VirtualShadowRendererThe sun's shadow at the resolution each pixel needs: phase 7's node.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
ShadowMapRenderer's replacement rather than its sibling, and the reason is the geometry. Four cascades are four fixed resolutions over a whole frustum, and the one a pixel gets is whichever slice it landed in — tolerable when the geometry is an authored LOD chain, and absurd when it is a cut chosen to put a cluster's error under a pixel. This node fits a clipmap instead: levels doubling in extent, centred on the camera and snapped to whole pages, of which only the pages some pixel actually asked for are allocated or drawn.
Four things happen here in an order nothing else can express. The marks the previous frame wrote are serviced, which allocates pages; the pages that hold nothing yet are drawn; the page table is uploaded; and this frame's depth is marked for the next one. The first three have to precede any shading pass that reads the table, and the fourth has to follow whatever wrote the depth — so this node is placed after the depth prepass and before the shading, and the ordering inside it is not a document's to get wrong.
The casters are the ordinary shadow-caster stage. docs/plan/22-virtualized-geometry.md phase 7 describes clusters cast through the same traversal with a different view record, which needs a visible list per view — the traversal produces one list for every view it was given, with no view tag on an entry. That is a change to phase 3's output rather than to this node, so it is named as owed and a virtualized mesh casts through the fallback mesh phase 1 generates for exactly this: the path the virtualized raster does not reach.
Fields and properties (18)
public required RenderStage CasterStageThe stage that draws depth-only casters.
public VirtualShadowAtlas? AtlasThe atlas, its pages and its residency. Null does nothing at all.
public ViewConstants? ConstantsThe per-view block to bind before each page's casters.
public ParameterCollection? SceneWhere to publish what a shading pass needs, or null to publish nothing.
public SamplerCache? SamplersWhere the comparison sampler comes from.
public IList<string> PassesWhich passes' compose slots the map is published under, qualified.
public RenderView? CameraThe camera the clipmap is centred on and whose depth is marked.
public string DepthWhich depth resource to mark from.
public Vector3 LightDirectionThe direction the sun's light travels, toward the scene.
public ISunSource? SunWhere the sun comes from, or null to use LightDirection.
public IList<Matrix4x4> SpotProjectionsOne projection per shadowed spot light, or empty.
public int ClipmapLevelsHow many levels the directional clipmap has.
public float FirstExtentHow wide clipmap level zero is, in world units.
public float DepthrangeHow deep each level's box is along the light, which is its caster range.
public int PagesPerFrameHow many pages may be allocated per frame.
public int DrawsPerFrameHow many pages may be drawn per frame.
public int MarkedPagesHow many pages the last frame's marking asked for.
public int DrawnPagesHow many pages the last frame drew.
Methods (3)
protected internal override void Collect(GraphicsCompositor compositor)protected internal override void Build(GraphicsCompositor compositor, CompositorFrame frame)Declares this node's render-graph passes.
public override string ToString()Returns a string that represents the current object.
Used by (3)
- ArenaThirdPersonShooter
- FrameDocumentTestsThirdPersonShooter.Frame.Tests
- CompositorBuilderVixen.Rendering