LightSyncSystem
Applies LightComponent authoring values to the underlying THREE.js light objects each frame, supporting directional, ambient, point, spot, hemisphere, and area light types.
Overview
LightSyncSystem runs every frame and is responsible for:
- Writing
color,intensity,castShadow, andfrustumCulledto every light object. - Writing
distanceanddecayforTHREE.PointLightandTHREE.SpotLight. - Writing
angleandpenumbraforTHREE.SpotLight. - Writing
widthandheightforTHREE.RectAreaLight.
Queried components
| Component | Access |
|---|---|
LightComponent | Read (values sub-state) |
Behavior notes
- Signature-based change detection — per-entity signatures are computed from the serialized
valuesobject each frame. Light properties are only written when the signature changes, preventing redundant THREE.js mutations on every frame. - Value clamping —
intensityis clamped to≥ 0.distanceis clamped to≥ 0.angleis clamped to[0, π/2].penumbrais clamped to[0, 1]. Non-finite values use safe defaults. - Stale entity cleanup — when an entity is destroyed the system removes its entry from the signature map to prevent unbounded memory growth.
API reference
- Class:
LightComponent - Source:
core/systems/LightSyncSystem.ts

