Vixen
02b45cc4
csharp
public sealed class TracedReflections

Reflections through the same tracer — doc 19 § L5, reference half.

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

Remarks

The layer that reuses everything below it, which is § L5's whole argument. A mirror ray marches L1's tracer — the same march every filler and gather here marches — and a hit answers through IRadianceSource, which is L4's seam: hand this the surface cache's SurfaceCacheRadiance and a reflection carries direct light, emissive and every bounce the radiosity folded in, with no code in this package knowing the cache exists. A miss asks the IReflectionFallback, which is where doc 06's reflection probes plug in as the far field they are actually good at.

Rough reflections read the field instead of tracing. At and above RoughnessThreshold the lobe is wide enough that one mirror ray is noise rather than an answer, and the cosine-weighted average the irradiance field already stores — evaluated about the mirror direction rather than the normal — is the wide-lobe limit of the same integral, amortised across every rough surface in the scene. That is Lumen's arrangement and doc 19 § L5's sentence, and it is a hard threshold here because a hard threshold is a testable one: the blend band between the two answers is the device half's concern, named below.

The view convention is incident. view points from the camera toward the surface, so the mirror direction is the textbook v − 2(v·n)n. Handing this the direction from the surface to the camera reflects the camera instead of the scene — the picture looks plausible and is wrong everywhere, which is why the convention is stated on the parameter and pinned by a closed form.

Fields and properties (7)

  • public float MaxDistance

    How far a mirror ray looks before deciding it escaped.

  • public float Bias

    How far off its surface a mirror ray starts, in world units.

  • public float RoughnessThreshold

    The roughness at and above which the field answers instead of the trace.

  • public float RoughnessBlend

    How far below the threshold the cross-fade starts, in roughness.

  • public IrradianceField? Field

    The irradiance field the rough path reads — doc 19 § L2's, when the scene has one.

  • public ScreenSpaceTrace? ScreenTrace

    The screen march the sharp path runs first, or null for the field alone.

  • public Func<Int2, Vector3>? ScreenColour

    The frame's colour at a pixel, for what a screen hit reflects.

Methods (2)

Used by (3)

  • ReflectionRendererDeviceTestsVixen.Graphics.Golden.Tests
  • ReflectionTraceDeviceTestsVixen.Graphics.Golden.Tests
  • TracedReflectionTestsVixen.Rendering.Reflections.Tests