Vixen
02b45cc4
csharp
public sealed class ScreenProbeTraceFill

Traces screen probes with a compute dispatch — doc 19 § L3's gather, first half.

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

Remarks

The device half of TracedScreenProbeGather, and checked against it. One workgroup per probe and one invocation per texel, with the probe a group is tracing read out of a job buffer indexed by the group — the same shape as IrradianceFieldFill, because it is the same problem one probe kind over.

The jobs are staged from the atlas, and only for the probes that have a surface. The atlas is where SetSurface and Invalidate already recorded what each anchor pixel showed, so the dispatch has no opinion about the screen at all. ⚠ By default a probe with no surface is not dispatched, and on a mirror the dispatch owns its patch is therefore undefined — nothing uploaded it and nothing traced it. A frame sets ClearInvalid and such probes get a job that writes the invalid mark instead, because the resolve reads validity out of the atlas.

Every binding index comes off the compiled effect rather than the generated constants, and set 2 is filled by hand because the job buffer is a ring and a name-driven write has nowhere to put an offset — both verbatim from the irradiance fill, which learnt them the hard way.

Fields and properties (24)

  • public const string ShaderName

    The shader this dispatches.

  • public EffectSystem? Effects

    Where the trace 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 string FarSource

    The shader behind the irradiance slot — where a ray that misses terminates.

  • public string CacheSource

    The shader behind the cache slot — what a ray that hits a surface sees.

  • public ParameterCollection Parameters

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

  • public float MaxDistance

    How far a ray looks before deciding it hit nothing.

  • public float SurfaceBias

    How far off its surface a probe stands, in world units.

  • public Vector3 SkyColour

    What a ray that hit nothing sees, straight ahead.

  • public Vector3 SkyGradient

    How much the sky changes per unit of a direction's y, per channel.

  • public TextureViewHandle ScreenDepth

    The frame's depth, for the trace order's first stage. Invalid traces no screen rays.

  • public Int2 ScreenViewport

    The viewport ScreenDepth covers, in pixels.

  • public Matrix4x4 ViewProjection

    The camera that drew the depth — the forward matrix, not placement's inverse.

  • public int ScreenSteps

    How many equal steps a screen ray takes over MaxDistance.

  • public float ScreenThickness

    How deep behind a surface a sample still counts as inside it, in device depth.

  • public TextureViewHandle ScreenPyramid

    The depth's nearest-per-cell chain — HiZPyramid wearing Nearest. Invalid keeps the fixed-step walk.

  • public int ScreenPyramidLevels

    How many levels the march may use, counting the depth itself — the CPU pyramid's own Levels, which is the chain's plus one.

  • public float ScreenLinearThickness

    How deep the shell is in view units, where a perspective ray can say. Zero keeps the device-depth shell — ScreenSpaceTrace.LinearThickness, choice for choice.

  • public bool ClearInvalid

    Whether probes with no surface get a job that clears their patch to the invalid mark.

  • public int Traced

    How many probes 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 ScreenProbeTraceFill(IGraphicsDevice device)

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

  • public int Record(ICommandList commands, ScreenProbeTexture texture)

    Records a dispatch that traces every valid probe of an atlas.

  • public void Dispose()

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

Used by (7)

  • ArenaIlluminationThirdPersonShooter
  • AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests
  • CompositorBuilderVixen.Rendering
  • PostEffectTestsVixen.Rendering.PostFx.Tests
  • ScreenProbeGatherImageTestsVixen.Graphics.Golden.Tests
  • ScreenProbeGatherRendererVixen.Rendering.PostFx
  • ScreenProbeTraceDeviceTestsVixen.Graphics.Golden.Tests