Vixen
02b45cc4
csharp
public sealed class HiZRenderer

Reduces the frame's depth into a HiZPyramid, for the next frame's culling to test against.

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

Remarks

The node exists because of one word in its declaration: reads. Depth is a graph resource — written by a prepass or by the opaque pass, aliased with whatever else fits its memory — and a dispatch that sampled it without saying so would run before the pass that filled it, or read it in the wrong layout, on whichever driver reordered them. Declaring the read is what orders the two and places the barrier, and it is the reason doc 06 says GPU occlusion culling needs the culler to be part of the compositor.

Placed after the pass that fills depth, not before the frame. What it reduces is this frame's depth, and what consumes it is next frame's Cull — which runs before anything is drawn and so can never have anything newer. That one frame of staleness is the whole cost of one-phase occlusion culling: something that was hidden last frame and is not now appears a frame late.

The pyramid outlives the graph, so the node does not declare it as a resource: a transient the graph aliased would be somebody else's pixels by the time the culler sampled it. See HiZPyramid.

Fields and properties (2)

  • public required string Depth

    The name of the depth texture to reduce.

  • public HiZPyramid? Pyramid

    The pyramid to build. Null does nothing at all.

Methods (1)

Used by (4)

  • FrameDocumentTestsThirdPersonShooter.Frame.Tests
  • CompositorAssetTestsVixen.Rendering.Tests
  • CompositorBuilderVixen.Rendering
  • GpuVisibilityGroupTestsVixen.Rendering.Tests