Vixen
02b45cc4
csharp
public sealed class ScreenProbeAtlas

Every screen probe's radiance map, surface, and resolved answer.

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

Remarks

The storage does not know what filled it — the same property, for the same reason, as the irradiance field's pool. A texel written by the CPU reference gather and a texel a compute shader will one day write are the same texel, and the resolve reads them the same way. That is what lets the shader be compared against this at all.

A probe without a surface is invalid, not black. A probe whose anchor pixel shows the sky has nothing to stand on and nothing to gather for; marking it black instead would pull every neighbouring pixel toward darkness through the bilinear filter, which is the screen-space version of the buried-probe leak the irradiance field's validity exists for. Invalid probes drop out of Irradiance and the weights renormalise over what is left.

The resolve is a projection with exact texel weights. Each map texel carries its own solid angle out of SolidAngles, so a map holding a constant radiance resolves to exactly that constant — the closed form every test starts from. The resolved probe stores what SphericalHarmonicsL1.Irradiance evaluates: irradiance over π, the number a shading pass multiplies by albedo, the same convention as the irradiance field — and clamped at zero on the way out for the same reason the field clamps: four coefficients can answer below zero for a normal facing away from all of the light, and a negative ambient term is a hole in the picture.

Fields and properties (5)

  • public ScreenProbeLayout Layout

    Where the probes stand.

  • public int AdaptiveCount

    How many adaptive probes are placed right now.

  • public int ValidCount

    How many probes have a surface.

  • public Vector3 this[Int2 probe, Int2 texel]

    One texel of one probe's map.

  • public Vector3 this[int adaptive, Int2 texel]

    One texel of one adaptive probe's map.

Methods (13)

  • public ScreenProbeAtlas(ScreenProbeLayout layout)

    Builds an empty atlas over a layout.

  • public void SetSurface(Int2 probe, Vector3 position, Vector3 normal)

    Gives a probe the surface it stands on.

  • public void Invalidate(Int2 probe)

    Marks a probe as standing on nothing.

  • public bool IsValid(Int2 probe)

    Whether a probe has a surface.

  • public bool TrySurface(Int2 probe, out Vector3 position, out Vector3 normal)

    The surface a probe stands on, when it has one.

  • public int PlaceAdaptive(Int2 pixel, Vector3 position, Vector3 normal)

    Places an adaptive probe on a pixel's surface, if the budget allows one more.

  • public void ClearAdaptive()

    Forgets every adaptive probe — the start of a new placement pass.

  • public void AdaptiveSurface(int index, out Int2 pixel, out Vector3 position, out Vector3 normal)

    The surface an adaptive probe stands on.

  • public SphericalHarmonicsL1 ResolvedAdaptive(int index)

    An adaptive probe's resolved radiance, as projected by the last Resolve.

  • public void Resolve()

    Projects every valid probe's map into its resolved answer.

  • public SphericalHarmonicsL1 Resolved(Int2 probe)

    A probe's resolved radiance, as projected by the last Resolve.

  • public Vector3 Irradiance(Int2 pixel, Vector3 normal)

    The indirect diffuse a pixel receives, over π.

  • public Vector3 Irradiance(Int2 pixel, Vector3 position, Vector3 normal, float tolerance)

    The indirect diffuse a pixel receives, over π — knowing where the pixel's surface is.

Used by (22)

  • AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests
  • AdaptiveProbeTestsVixen.Rendering.ScreenProbes.Tests
  • CornellBoxTestsVixen.Rendering.SurfaceCache.Tests
  • ExitCriteriaTestsVixen.Rendering.ScreenProbes.Tests
  • ReconstructedScreenSurfaceTestsVixen.Rendering.ScreenProbes.Tests
  • ScreenProbeAccumulateDeviceTestsVixen.Graphics.Golden.Tests
  • ScreenProbeAccumulateFillVixen.Rendering
  • ScreenProbeBilateralImageTestsVixen.Graphics.Golden.Tests
  • ScreenProbeGatherImageTestsVixen.Graphics.Golden.Tests
  • ScreenProbeGatherRendererVixen.Rendering.PostFx
  • ScreenProbeHistoryVixen.Rendering.ScreenProbes
  • ScreenProbeHistoryTestsVixen.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