Vixen
02b45cc4
csharp
public sealed class OccluderProjections

Each view's matrix from the frame a depth pyramid was built in, which is the only matrix its rectangle may be projected with.

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

Remarks

Its own type because there are two consumers of it. The object cull (GpuVisibilityGroup) and the cluster traversal (GpuClusterVisibility) both test spheres against the same pyramid with the same matrix, and both have to answer the same awkward question first: is this view one whose matrix I remember? Two copies of that rule is two places for it to be relaxed — and the way it gets relaxed is by projecting a view's bound with a matrix that belonged to a different view, which occludes geometry by arithmetic that was never about it.

Dropped whole whenever the number of views changes. "Index two" meaning "the second shadow cascade" is a convention of the host's, and a frame that inserted a view has renumbered everything after it — so a remembered matrix at an index is only about the same view if the shape of the list has not moved. That is conservative in the right direction: the frame after a view list changes is frustum-only rather than wrong.

Fields and properties (1)

  • public int Count

    How many views were remembered, or -1 if none have been.

Methods (4)

  • public bool Matches(int viewCount)

    Whether this many views is the shape that was remembered.

  • public void Remember(IReadOnlyList<RenderView> frameViews)

    Records the matrices the next frame's occlusion test will project with.

  • public bool TryGet(int viewIndex, out Matrix4x4 projection)

    The matrix a view's bound may be projected with, if there is one.

  • public void Forget()

    Forgets everything, so the next frame is frustum-only.

Used by (2)

  • GpuClusterVisibilityVixen.Rendering
  • GpuVisibilityGroupVixen.Rendering