Vixen
02b45cc4
csharp
public sealed class IrradianceRefinementPolicy

Decides where an irradiance field should be fine — doc 19 § 3's "from renderer bounds".

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

Remarks

Refine could always do this and nothing ever called it. A field allocated at one size everywhere spends its pool on empty air and is too coarse exactly where it matters, which is the neighbourhood of a surface: doc 19's risk G3 is that light leaks through walls, and the knob is how thick a wall is in probes. Refinement is what makes a wall thicker in probes without making the whole field finer.

Bands, coarsest first, and the order is what grades the field. Refine only splits bricks larger than its target, so a wide band at size four followed by a narrow one at size one leaves three resolutions standing: fine against the surface, medium around it, coarse in the air. Applying them the other way round would refine everything to one and the wide band would find nothing to do.

It coarsens what nothing protects, when told to. Refinement only ever adds detail, so a field driven by bands alone over a long session ratchets toward its finest everywhere the geometry has ever been — wrong for a streamed scene, whose pool never gets slots back. With CoarsenTo set, every aligned group of bricks finer than it whose merged extent no band still claims at a finer size is merged back, probes subsampled rather than discarded. A region a band does claim is protected — including the regions this very call refined, which is what keeps one Apply from undoing itself — and CoarsenMargin widens every claim, so a box teetering on a brick boundary does not split and merge the same octet on alternating frames.

Running out of pool is not an error. Split skips a child it cannot allocate, so a policy that asks for more than the pool holds produces a field that is fine where it got to and coarse after — a quality reduction rather than a failure, which is what doc 19 § 7 says a fixed pool is for.

Fields and properties (5)

  • public IList<IrradianceRefinementBand> Bands

    The bands, applied coarsest first whatever order they are given in.

  • public int Refined

    How many bricks the last Apply produced.

  • public int CoarsenTo

    The size bricks relax back to where no band claims them finer. Zero never coarsens.

  • public float CoarsenMargin

    Extra width every band keeps while deciding what may coarsen, in world units.

  • public int Coarsened

    How many merges the last Apply performed.

Methods (1)

Used by (5)

  • CompositorBuilderVixen.Rendering
  • IrradianceCoarseningTestsVixen.Rendering.IrradianceFields.Tests
  • IrradianceFieldRendererVixen.Rendering
  • IrradianceRefinementPolicyTestsVixen.Rendering.IrradianceFields.Tests
  • IrradianceRefinementTestsVixen.Rendering.Tests