Vixen
02b45cc4
csharp
public sealed class ReflectionTraceFill

Traces reflections per texel with a compute dispatch — doc 19 § L5's device half.

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

Remarks

The device half of TracedReflections, and checked against it texel by texel. Every composed answer comes through the slots the kernels already share: the march through distanceField, the hit through surfaceCache, the rough read through irradiance, and the miss through miss — the seat doc 06's reflection probes take without this kernel changing a line.

The input planes and the target are the caller's — world positions with validity, normals with roughness, and the storage image the answer lands in. This binds and dispatches; the textures' states are whoever owns them's to arrange, with the target in PlaneIsBeingWritten across the dispatch, the way every written plane here is bracketed.

Fields and properties (31)

  • public const string ShaderName

    The shader this dispatches.

  • public EffectSystem? Effects

    Where the 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 mirror rays actually march.

  • public string CacheSource

    The shader behind the cache slot — what a hit answers with.

  • public string RoughSource

    The shader behind the irradiance slot — what the rough path reads.

  • public string MissSource

    The shader behind the miss slot — the far field, which is the probes' seat.

  • public ParameterCollection Parameters

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

  • public TextureViewHandle Positions

    The reflecting surfaces: world position in xyz, validity in alpha.

  • public TextureViewHandle Normals

    Their normals in xyz, roughness in alpha.

  • public TextureViewHandle Target

    The storage image the answer lands in.

  • public Int2 Viewport

    How many texels the planes cover.

  • public Vector3 CameraPosition

    Where the camera stands — the view direction is toward the surface.

  • 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.

  • 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. Zero is the hard switch.

  • public TextureViewHandle ScreenDepth

    The frame's depth, for the screen march — invalid for no screen trace at all.

  • public TextureViewHandle ScreenColour

    The frame's colour, which is what a screen hit reflects.

  • public Matrix4x4 ViewProjection

    The camera that drew both — the forward matrix.

  • public Int2 ScreenViewport

    The viewport they cover, in pixels.

  • public int ScreenSteps

    How many equal steps a screen ray takes. Written as zero while either view is invalid, so the descriptors can hold a stand-in the kernel never loads.

  • 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 ReconstructFromDepth

    Whether positions come from ScreenDepth rather than a positions plane.

  • public Matrix4x4 InverseViewProjection

    What turns a pixel's depth back into the world, when reconstructing.

  • 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 ReflectionTraceFill(IGraphicsDevice device)

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

  • public int Record(ICommandList commands)

    Records a dispatch that reflects every valid texel of the planes.

  • public void Dispose()

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

Used by (4)

  • ArenaIlluminationThirdPersonShooter
  • ReflectionRendererVixen.Rendering.PostFx
  • ReflectionRendererDeviceTestsVixen.Graphics.Golden.Tests
  • ReflectionTraceDeviceTestsVixen.Graphics.Golden.Tests