Vixen
02b45cc4
csharp
public readonly record struct IrradianceProbe

Everything one point in a field knows about the light arriving there.

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

Remarks

Six floats per channel and two scalars, which is the whole payload of dynamic global illumination. docs/plan/19 § 3 fixes it deliberately: L1 spherical harmonics for the indirect diffuse, a validity scalar so a probe that ended up inside a wall can be ignored rather than believed, and a shadowing scalar for the directional light so static shadow data has something to be replaced by.

Validity is the leak fix, and it is carried here rather than derived at sample time because only the filler can know it. A probe that traced its rays and found itself surrounded by backfaces is inside geometry; nothing at the sampling end can tell that from a probe in a dark room. Doc 19 carries leaks as risk G3 — the defect users actually report — and every part of the remedy starts from this number.

A record struct, so a brick is sixty-four of these laid out end to end and equality comes for free. Unlike SphericalHarmonicsL1 the field layout here is not the contract with a shader: the upload splits a brick into separate volume textures per coefficient, because that is what a hardware trilinear fetch wants to read.

Fields and properties (4)

  • public SphericalHarmonicsL1 Radiance

    What arrives, projected onto four basis functions per channel. Radiance rather than irradiance — a surface's normal is not known until something asks, and Irradiance is what asks.

  • public float Validity

    How much of this probe is worth believing, from zero to one. Zero for a probe buried in geometry, one for a probe in open air.

  • public float SunShadow

    How much of the directional light reaches here, from zero to one. What replaces baked static shadow data — see doc 19 § 4.

  • public static IrradianceProbe Empty

    A probe that has seen nothing and should not be believed.

Methods (4)

Used by (20)

  • CapturedIrradianceFillerVixen.Rendering
  • CapturedIrradianceFillerTestsVixen.Rendering.Tests
  • IndirectDiffuseImageTestsVixen.Graphics.Golden.Tests
  • IrradianceBrickPoolVixen.Rendering.IrradianceFields
  • IrradianceBrickPoolTestsVixen.Rendering.IrradianceFields.Tests
  • IrradianceCaptureDeviceTestsVixen.Graphics.Golden.Tests
  • IrradianceCoarseningTestsVixen.Rendering.IrradianceFields.Tests
  • IrradianceConvergenceTestsVixen.Rendering.IrradianceFields.Tests
  • IrradianceFieldVixen.Rendering.IrradianceFields
  • IrradianceFieldTestsVixen.Rendering.IrradianceFields.Tests
  • IrradianceFieldTextureVixen.Rendering
  • IrradianceFillDeviceTestsVixen.Graphics.Golden.Tests
  • IrradianceProbeTestsVixen.Rendering.IrradianceFields.Tests
  • IrradianceRepairDeviceTestsVixen.Graphics.Golden.Tests
  • LeakTestsVixen.Rendering.IrradianceFields.Tests
  • ProbesVixen.Rendering.IrradianceFields.Tests
  • SamplingConventionTestsVixen.Rendering.IrradianceFields.Tests
  • TracedIrradianceFillerVixen.Rendering.IrradianceFields
  • TracedIrradianceFillerTestsVixen.Rendering.IrradianceFields.Tests
  • TracedScreenProbeGatherVixen.Rendering.ScreenProbes