Vixen
02b45cc4
csharp
public sealed class IrradianceFieldFill

Fills an irradiance field's probes with a compute dispatch — doc 19 § L2's filler A.

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

Remarks

The device half of TracedIrradianceFiller, and checked against it. One workgroup per brick and one invocation per probe: sixty-four threads marching sixty-four rays each, with the brick a group is filling read out of a job buffer indexed by the group. That is what lets one dispatch refill N bricks rather than N dispatches, and N is Budget's number.

It is not a ComputeRenderer, and cannot be. That node binds resources by graph name; the pool volumes are not graph resources — they are named into a descriptor set — so nothing in the graph can see them and nothing else will transition them. This is the same shape HiZPyramid is, for the same reason.

Every binding index comes off the compiled effect rather than the generated constants. Those describe one variant — the reflection checked in beside the shader was produced with GlobalDistanceField filling the slot — and a different implementation behind distanceField may declare resources of its own, which renumbers everything after them. The names are safe and are what this asks by; the numbers are the compilation's.

The dispatch writes the sixty-four probes a brick owns and nothing else, which is exactly what the reference filler writes — so the two can be compared to the last coefficient. The border plane and the repair of invalid probes belong to IrradianceFieldRepair, which this owns and runs after every fill, in the order Dilate and SyncBorders insist on. One call rather than two, because a fill without its repair leaves a rind and a seam that read as lighting bugs rather than as a missing line.

Fields and properties (17)

  • public const string ShaderName

    The shader this dispatches.

  • public IrradianceFieldRepair Repair

    The dilation and border sync that run after every fill.

  • public EffectSystem? Effects

    Where the fill variant is resolved from. Null dispatches nothing.

  • public ComputePipelineCache? Pipelines

    Where the compute pipeline comes from. Null dispatches nothing.

  • public DescriptorAllocator? Descriptors

    Where the descriptor sets come from. Null dispatches nothing.

  • public string Source

    The shader behind the field slot — what the rays actually march.

  • public ParameterCollection Parameters

    What the two sets are filled from, by the names the reflection interned.

  • public int RayCount

    How many directions each probe looks in.

  • public float MaxDistance

    How far a ray looks before deciding it hit nothing.

  • public Vector3 SkyColour

    What a ray that hit nothing sees.

  • public Vector3 SunDirection

    Which way the sun is, in world space.

  • public float SunSoftness

    The reciprocal of the sun's angular radius. Larger is a sharper shadow.

  • public float Hysteresis

    How much of the previous answer survives a fill, from zero to one.

  • public int Cursor

    Which indirection cell the next dispatch starts at.

  • public int Filled

    How many bricks have been dispatched since this was made.

  • public int Dispatches

    How many dispatches have been recorded.

  • public string? Skipped

    Why the last call recorded nothing, or null when it recorded something.

Methods (3)

  • public IrradianceFieldFill(IGraphicsDevice device)

    Creates a filler on a device. Nothing is allocated until the first dispatch.

  • public int Record(ICommandList commands, IrradianceField field, IrradianceFieldTexture texture, int budget)

    Records a dispatch that refills up to bricks.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (4)

  • CompositorBuilderVixen.Rendering
  • IrradianceFieldRendererVixen.Rendering
  • IrradianceFillDeviceTestsVixen.Graphics.Golden.Tests
  • IrradianceShadingDeviceTestsVixen.Graphics.Golden.Tests