Vixen
02b45cc4
csharp
public sealed class ReflectionRenderer

Traced reflections over a real frame — doc 19 § L5 in the compositor.

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

Remarks

The node that turns the kernel's fixture contract into a frame's. The device tests hand ReflectionTrace a positions plane; a frame has no such thing — it has the depth it drew and the normals its G-buffer holds. This node points the kernel at both, switches it into reconstruction (the same Transform.UvDepthToWorld placement and the upsample lean on), and reuses the very same depth for the screen march, so SSR and reconstruction cannot disagree about which camera drew the frame.

The normals resource is a contract: world normal in xyz, roughness in alpha. A G-buffer that packs differently writes an adapter pass, not a different kernel.

The composed sources are the host's. The clipmap, the surface cache, the field and the miss probes each belong to whoever owns them, and each writes its names into Trace's parameters under ReflectionTrace.<source>.* — this node knows about ordering and the frame, nothing else, the arrangement every renderer node here keeps.

Fields and properties (23)

  • public string Depth

    The frame resource the positions are reconstructed from and the screen march reads.

  • public string Normals

    The frame resource holding world normals in xyz and roughness in alpha.

  • public string Target

    The name this node publishes its answer under — radiance in rgb, validity in alpha.

  • public string? Colour

    The frame resource a screen hit reflects, or null for no screen march at all.

  • public EffectSystem? Effects

    Where the kernel's variant is resolved from. Null dispatches nothing.

  • public ComputePipelineCache? Pipelines

    Where the compute pipeline comes from. Null dispatches nothing.

  • public DescriptorAllocator? Allocator

    Where the descriptor sets come from. Null dispatches nothing.

  • public IGraphicsDevice? Device

    The device the output is made on, or null to take the frame's.

  • public Matrix4x4 ViewProjection

    The camera that drew the frame — the forward matrix, for the screen march.

  • public Matrix4x4 InverseViewProjection

    Its inverse, for the reconstruction. The host has both; inverting here would manufacture error.

  • public Vector3 CameraPosition

    Where the camera stands.

  • public RenderView? View

    The view whose camera drives the three above, or null for a host that sets them.

  • 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 int ScreenSteps

    How many equal steps a screen ray takes.

  • public float ScreenThickness

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

  • public HiZPyramid? Pyramid

    The nearest chain the screen march skips by, or null for the fixed-step walk.

  • public float ScreenLinearThickness

    How deep the march's shell is in view units, where a perspective ray can say. Zero keeps the device-depth shell — forwarded to ScreenLinearThickness.

  • public ReflectionTraceFill? Trace

    The kernel's driver — the composed sources are set here.

  • public string? Skipped

    Why the last frame recorded nothing, or null.

  • public TextureHandle Output

    The published answer's texture — for a test's readback or a host's own composite.

Methods (2)

  • protected override void Build(GraphicsCompositor compositor, CompositorFrame frame)

    Declares this node's render-graph passes.

  • public void Dispose()

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

Used by (6)

  • ArenaThirdPersonShooter
  • ArenaIlluminationThirdPersonShooter
  • FrameDocumentTestsThirdPersonShooter.Frame.Tests
  • PostEffectFactoryVixen.Rendering.PostFx
  • PostEffectTestsVixen.Rendering.PostFx.Tests
  • ReflectionRendererDeviceTestsVixen.Graphics.Golden.Tests