Lighting
The engine supports up to 8 dynamic lights using Blinn-Phong shading. Lights are ECS entities with a Light component and a Transform for position.
Light Types
Directional Light
A light that shines in a single direction from infinitely far away (like the sun). Position is ignored; only direction matters.
Point Light
A light that emits in all directions from a position. Attenuates with distance based on Radius.
Spot Light
A cone-shaped light from a position in a direction. Uses inner and outer cone angles for smooth falloff.
Ambient Light
Control the base ambient lighting level:
LightSyncSystem
The LightSyncSystem runs each frame and pushes all Light + Transform entities to the renderer. It:
- Queries all entities with both components
- Assigns each light a slot (0-7)
- Clears unused slots
Lights beyond slot 7 are ignored. The system automatically manages slot assignment — you don't need to set _LightIndex manually.