Vixen
02b45cc4
csharp
public sealed class ScreenProbeHistory

Screen probes accumulated across frames — the denoiser's opening move.

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

Remarks

Why this exists before any spatial filter. Doc 19 § L3's own warning is that the un-denoised gather looks worse than § L2 alone: sixty-four rays per probe is a noisy estimate, and the cheapest variance reduction is the frames already paid for. A probe's resolved projection is blended with its own history — (history · w + current) / (w + 1), the running mean, with MaxFrames capping w so the oldest frames age out and a moved light converges instead of lingering.

History follows the surface, not the tile. A probe is anchored to a screen tile, but what it measured is the light at a surface — so this frame's surface is projected through last frame's camera to find the probe that stood on it then. The lattice ran a frame behind the camera from the day the gather node existed; this is where that staleness gets its name and its answer.

Disocclusion is rejected by the plane test placement already trusts. A reprojected probe whose stored surface plane the current surface does not lie on — farther than Tolerance, ScreenProbeAtlas's own mismatch — measured a different surface, and blending it in is ghosting: last frame's wall smeared over this frame's doorway. Rejected history starts over at weight one, which is noisy and honest; the spatial filter that will hide the restart is the denoiser's next move, not this one.

The buffers are double-buffered internally: reprojection reads neighbouring slots while writing others, and a camera pan would otherwise blend half-updated history into itself.

Fields and properties (7)

  • public ScreenProbeLayout Layout

    The lattice the history covers.

  • public Matrix4x4 ViewProjection

    The camera of the frames already inside — what reprojection projects through.

  • public int MaxFrames

    How many frames a probe's history may weigh at most.

  • public float Tolerance

    How far off a history probe's plane this frame's surface may stand, in world units.

  • public int Frames

    How many accumulations have run.

  • public int Reprojected

    How many probes reused their history in the last accumulation.

  • public int Rejected

    How many probes rejected a reprojected history as a different surface.

Methods (5)

  • public ScreenProbeHistory(ScreenProbeLayout layout)

    Builds an empty history over a lattice. The first accumulation keeps nothing.

  • public SphericalHarmonicsL1 Resolved(Int2 probe)

    A probe's accumulated projection.

  • public float Weight(Int2 probe)

    How many frames stand behind a probe's answer — zero for a probe with none.

  • public void Accumulate(ScreenProbeAtlas atlas, Matrix4x4 viewProjection)

    Folds one frame's resolved probes into the history.

  • public void Filter(Span<SphericalHarmonicsL1> into, float strength, float tolerance)

    The accumulated probes, spatially filtered — the denoiser's second move.

Used by (3)

  • ExitCriteriaTestsVixen.Rendering.ScreenProbes.Tests
  • ScreenProbeAccumulateDeviceTestsVixen.Graphics.Golden.Tests
  • ScreenProbeHistoryTestsVixen.Rendering.ScreenProbes.Tests