Vixen
02b45cc4
csharp
public sealed class VisibilityBufferRenderer

Draws every visible cluster into a visibility buffer: phase 4, placed in the frame.

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

Remarks

A graph pass, unlike its two siblings. GpuCullingRenderer and ClusterCullingRenderer declare no resources and are side effects, because what they write are buffers that outlive the graph. This one writes a texture the rest of the frame reads, so it declares it — and the graph then aliases it, transitions it and hands it to whatever names it, exactly as it does for a depth target or a bloom chain.

The identity target clears to all ones, not to zero. Zero is a real identity — the first cluster of the frame, its first triangle — so a pixel nothing covered would read as geometry. Nothing is what the resolve tests against, and this is the only place it gets written.

It needs a depth target and does not own one. The whole reason phase 4 needs no atomics is that the hardware's depth test resolves which cluster is nearest, so a pass without depth would write whichever identity the rasterizer happened to reach last. Naming an existing depth resource rather than creating one is deliberate: a frame that also draws classic geometry wants both in one depth buffer, or the two occlude each other not at all.

Fields and properties (14)

  • public GpuClusterRaster? Raster

    The raster that records the draw. Null does nothing at all.

  • public GpuClusterSoftwareRaster? Software

    The software raster for the clusters the traversal thought too small. Null draws none.

  • public GpuVisibilityTiles? Tiles

    The binning pass that sorts this buffer's tiles by material. Null draws it and stops there.

  • public GpuClusterResolve? Resolve

    The per-material shading that consumes those bins. Null bins them and stops there.

  • public SceneConstants? SceneConstants

    The frame's per-frame constants, which the resolve's lighting reads.

  • public ViewConstants? ViewConstants

    The frame's per-view constants, on the same terms.

  • public string Colour

    What the shaded colour is called in the graph.

  • public string Output

    What the identity target is called in the graph, for whatever resolves it.

  • public string Albedo

    The split's albedo plane — diffuse albedo, the material's occlusion in alpha. Named with Normals or not at all; empty keeps the combined path.

  • public string Normals

    The split's normal plane — world normal, roughness in alpha. On Albedo's terms.

  • public string Depth

    Which depth resource to test and write against.

  • public int ViewIndex

    Which view's camera the clusters are projected with.

  • public RenderView? View

    The view it draws from, and the one the traversal chooses a cut for.

  • public RenderStageMask Stages

    Which stages' objects this buffer draws — the mask the traversal tests instances against.

Methods (2)

Used by (5)

  • FrameDocumentTestsThirdPersonShooter.Frame.Tests
  • CompositorAssetTestsVixen.Rendering.Tests
  • CompositorBuilderVixen.Rendering
  • SceneRenderHostTestsVixen.Engine.Renderer.Tests
  • VirtualGeometryGoldenTestsVixen.Graphics.Golden.Tests