public sealed class LightExtractionSystemTurns the scene's Light entities into the lighting feature's frame list.
No guide page documents this yet — the page shows what the code says about itself.
As a system
- Phase
- PreRender
- Reads
- Light WorldTransform
Remarks
The bridge, and it is a copy rather than a translation. Light holds what a light is and RenderLight holds what the shader needs — the same fields, plus the position and the basis folded in from the transform. That the two line up is deliberate: a bridge that had to reinterpret values would be a place for the authored meaning and the rendered one to drift apart.
Rebuilt every frame rather than mirrored. A light has no handle to keep, so there is nothing to reconcile: the list is cleared and refilled, which costs a walk over the handful of entities that emit light and removes the entire class of bug where a destroyed entity leaves a light burning. That is the opposite trade from PhysicsBody, where the handle is expensive to create and is therefore kept — and the difference is exactly that a body is state and a light is not.
In PreRender, ordered by its declared access. TransformSystem writes WorldTransform in the same phase and this reads it, so the dependency graph puts this second — which is what makes a light's position this frame's rather than last frame's. Naming the phase alone would not have been enough.
⚠ The transform supplies position and orientation, and the component supplies neither. A directional light has no position and reads only its forward axis; a point light has no orientation and reads only its position; the two area kinds need a whole basis. Every one of them takes it from WorldTransform, so a light is aimed with the rotate gizmo and a scene file cannot say two different things about where one points.
Fields and properties (2)
public int LightCountHow many lights the last pass put in the list.
public SystemAccess Access
Methods (4)
public LightExtractionSystem(ForwardLightingRenderFeature feature)Turns the scene's Light entities into the lighting feature's frame list.
public override JobHandle Update(in SystemContext context, JobHandle dependency)Runs the system.
public void Extract(World world)Refills the lighting feature's list from the world.
public static RenderLight Convert(Light light, in Matrix4x4 matrix)One authored light, in the form the lighting feature reads.
Used by (2)
- LightExtractionTestsVixen.Rendering.Tests
- WorldRendererVixen.Engine.Renderer