Vixen
02b45cc4
csharp
public readonly struct ScreenProbeLayout

Where the screen probes stand, and where each one's map lives in the atlas.

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

Remarks

One probe per tile of pixels, anchored at the tile's centre. Doc 19 § L3's "~16 px screen grid": the gather is far too expensive per pixel, so it runs at one probe per tile and every pixel interpolates the four probes around it. Sixteen is the default and a parameter, because the right number is a quality setting and not a law.

The interpolation lattice is the unclamped one. An edge tile's anchor is clamped into the viewport — a probe has to stand on a pixel that exists — but the bilinear weights are computed on the regular lattice and clamped at the border, so a pixel outside the outermost anchors takes the nearest probe whole rather than extrapolating. The same shape, for the same reason, as the irradiance field repeating its last probe at the edge: the answer stops changing rather than inventing.

Adaptive probes — extra placements where the coarse grid straddles a depth edge, doc 19's "adaptive placement at disocclusions" — are deliberately not here yet. They are an addition to this lattice, not a replacement for it, and the lattice has to be right first.

Fields and properties (8)

  • public Int2 Viewport

    The viewport the probes cover, in pixels.

  • public int TileSize

    How many pixels one probe stands for, along each axis.

  • public int MapResolution

    How many texels a probe's octahedral map is, along each axis.

  • public Int2 GridSize

    How many probes there are, along each axis.

  • public int ProbeCount

    How many grid probes there are in all.

  • public int AdaptiveRows

    How many rows of adaptive maps sit below the grid's in the atlas.

  • public int AdaptiveCapacity

    How many adaptive probes the atlas has room for.

  • public Int2 AtlasSize

    The atlas holding every probe's map, in texels — grid rows, then adaptive rows.

Methods (6)

  • public ScreenProbeLayout(Int2 viewport, int tileSize = 16, int mapResolution = 8, int adaptiveRows = 0)

    Lays probes over a viewport.

  • public Int2 AdaptiveOrigin(int index)

    Where an adaptive probe's map starts in the atlas.

  • public int ProbeIndex(Int2 probe)

    One probe's place in a flat array.

  • public Int2 Anchor(Int2 probe)

    The pixel a probe stands on.

  • public Int2 AtlasOrigin(Int2 probe)

    Where a probe's map starts in the atlas.

  • public void Bilinear(Int2 pixel, Span<ScreenProbeTap> taps)

    The four probes around a pixel, and how much of its answer each carries.

Used by (25)

  • AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests
  • AdaptiveProbeTestsVixen.Rendering.ScreenProbes.Tests
  • AtlasConventionTestsVixen.Rendering.ScreenProbes.Tests
  • ExitCriteriaTestsVixen.Rendering.ScreenProbes.Tests
  • ScreenProbeAccumulateDeviceTestsVixen.Graphics.Golden.Tests
  • ScreenProbeAccumulateFillVixen.Rendering
  • ScreenProbeAtlasVixen.Rendering.ScreenProbes
  • ScreenProbeBilateralImageTestsVixen.Graphics.Golden.Tests
  • ScreenProbeFilterFillVixen.Rendering
  • ScreenProbeGatherImageTestsVixen.Graphics.Golden.Tests
  • ScreenProbeGatherRendererVixen.Rendering.PostFx
  • ScreenProbeHistoryVixen.Rendering.ScreenProbes
  • ScreenProbeHistoryTestsVixen.Rendering.ScreenProbes.Tests
  • ScreenProbeHistoryTextureVixen.Rendering
  • ScreenProbeLayoutTestsVixen.Rendering.ScreenProbes.Tests
  • ScreenProbeResolveVixen.Rendering
  • ScreenProbeResolveDeviceTestsVixen.Graphics.Golden.Tests
  • ScreenProbeTextureVixen.Rendering
  • ScreenProbeTraceDeviceTestsVixen.Graphics.Golden.Tests
  • ScreenProbeTraceFillVixen.Rendering
  • ScreenProbeUpsampleImageTestsVixen.Graphics.Golden.Tests
  • ScreenProbeUpsampleRendererVixen.Rendering.PostFx
  • ScreenSpaceTraceTestsVixen.Rendering.ScreenProbes.Tests
  • TracedScreenProbeGatherVixen.Rendering.ScreenProbes
  • TracedScreenProbeGatherTestsVixen.Rendering.ScreenProbes.Tests