public sealed class SurfaceCacheRendererKeeps the surface cache captured, lit and bounced, frame by frame — doc 19 § L4 live.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The counterpart to IrradianceFieldRenderer, and the same shape for the same reasons: a store that knows how to hold surfaces, a mirror that knows how to copy one up, kernels that know how to light one, and this to sequence them — capture, then light, then the bounce, then the swap, in an order a caller cannot accidentally invert.
The capture is one card a frame, one frame late. SurfaceCardCapture holds a single card's readback, and a readback is only readable after its submit — so each frame first decodes the card recorded last frame into the store, then records the next card round-robin. That is the budget's floor and its current ceiling; a wider budget is a capture with more readbacks in flight, and it can arrive without this node's order changing.
One author per plane, never two. Radiosity lights and bounces on the CPU and the upload carries the result; LightFill and GatherFill dispatch, and the mirror then refuses to copy the planes they own. Asking for both is refused rather than resolved, for DeviceFiller's exact reason: lighting that flickers between two answers is not a mode anybody chose.
The gather's set 0 is applied here, before its record, and that is load-bearing. The bounce reads the front of the double buffer while writing the back, so the cache's names must be written with the front as it stands, and the swap must come after the record — one frame's bounce reading the previous frame's answer, which is the recurrence the CPU pair converges by. Consumers named in Passes get the post-swap front, so a trace this frame reads the bounce this frame produced.
Fields and properties (16)
public SurfaceCacheStore? StoreThe cache to keep. Null does nothing at all.
public SurfaceCardCapture? CaptureWhat captures cards at runtime, or null for a store somebody captured already.
public SurfaceCardCapture.DrawCard? DrawWhat the capture draws — the scene, by whoever knows how to draw it.
public CardRadiosity? RadiosityWhat lights and bounces on the CPU, or null for a cache the dispatches author.
public SurfaceCacheLightFill? LightFillThe lighting dispatch — doc 19 § L4's direct pass on the device.
public SurfaceCacheGatherFill? GatherFillThe bounce dispatch. Recording it is what advances the swap.
public SurfaceCacheTexture? TextureIts mirror on the device, made on the first build.
public SceneConstants? SceneConstantsWhere the consumers' names go — the frame's set 0.
public IList<string> PassesWhich passes read this cache through the composed sampler.
public string SourceThe shader filling the slot, which is the other half of every binding's name.
public Vector3 TowardSunFrom the surface toward the sun, for the CPU lighting path.
public Vector3 SunIrradianceThe sun's irradiance on a perpendicular surface, for the CPU lighting path.
public IGraphicsDevice? DeviceThe device its texture is made on, or null to take the frame's.
public int CapturedHow many texels the runtime capture has decoded into the store.
public int BouncesHow many bounces have been recorded or run since this node was made.
public float LastChangeThe largest change the last CPU gather saw, per channel maximum.
Methods (2)
protected internal override void Build(GraphicsCompositor compositor, CompositorFrame frame)Declares the pass that keeps the cache.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (5)
- ArenaThirdPersonShooter
- ArenaIlluminationThirdPersonShooter
- CompositorAssetTestsVixen.Rendering.Tests
- CompositorBuilderVixen.Rendering
- SurfaceCacheRendererDeviceTestsVixen.Graphics.Golden.Tests