public sealed class SceneLightingWhat a scene's lighting is, as the names a pass's per-frame set is filled through.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The step everything else was waiting for. Apply and Apply have known how to write themselves for some time, and ForwardLightingRenderFeature writes a probe index per object — into an array nothing was putting probes into. This walks the objects a scene holds into Parameters, so that index points at something.
The array's length is the shader's, and the order is the selector's. The length comes off the effect's own plan, because ProbeCount is a permutation that sizes a binding; the order has to be Probes' own, because the index the per-object block carries is a position in that list. Sorting them here — by weight, by priority, anything — would silently point every object at a different probe than the one that was chosen for it.
Every slot is filled, including the empty ones. A frame with two probes and an array of four still owes the set four descriptors: the shader samples probes[clamp(probeIndex, 0, ProbeCount - 1)] and only then weighs the result against zero, so a slot with no descriptor is read rather than skipped. The spare slots take the environment's own cube, which is the right answer as well as a valid one — it is what a surface with no probe reflects.
What it does not write is as deliberate: the shadow map and its matrix belong to whatever rendered the shadows, and the light and cluster buffers to the features that filled them. Those are handles a frame produced, and their producers already hold them — this turns the objects a scene holds into names, which is a different job with a different lifetime.
Fields and properties (7)
public EnvironmentLight? EnvironmentThe scene's sky, or null for a scene lit by lamps alone.
public ReflectionProbeSelector? ProbesThe probes to bind, in the order an object's index refers to them.
public ISunSource? SunWhere the directional light comes from — the lighting feature, or a scene's own.
public RenderCamera? CameraThe camera the frame's froxel grid is built in, or null to write no grid parameters.
public int SlotsHow many probe slots the last extract found the shader had.
public int BoundHow many of those slots a probe of its own filled.
public int DroppedHow many probes the array had no room for.
Methods (1)
public void Extract(ParameterCollection parameters, Effect effect)Writes the scene's lighting into the names one pass reads it under.
Used by (7)
- ArenaThirdPersonShooter
- ArenaFrameThirdPersonShooter
- ForwardFrameTestsVixen.Rendering.Tests
- FrameVixen.Rendering.Tests
- SceneConstantsVixen.Rendering
- SceneLightingTestsVixen.Rendering.Tests
- WorldRendererVixen.Engine.Renderer