DirectionalLight
fun FilamentSceneScope.DirectionalLight(direction: Direction = Direction(0.3f, -1f, -0.5f), color: LinearColor = LinearColor(1f, 1f, 1f), intensity: LightIntensity = LightIntensity.LuminousPower(100_000f), shadow: ShadowConfig? = null, castLight: Boolean = true, lightChannels: Set<Int> = setOf(0), followGroupRotation: Boolean = true)
A directional light — parallel rays from infinitely far (the classic "sun" for shading, without the visible disk; use SunLight for that). Only directional and spot lights can cast shadows.
DirectionalLight(
direction = Direction(0.3f, -1f, -0.5f),
intensity = LightIntensity.LuminousPower(100_000f), // lux
shadow = ShadowConfig(mapSize = 2048, cascades = 3),
)Content copied to clipboard
Parameters
direction
Light direction in world space (need not be a unit vector).
color
Linear-sRGB colour; channels may exceed 1 for an over-bright tint.
intensity
Brightness and its unit as one value (LightIntensity) — lux/lumen, candela, or watts + efficiency.
shadow
Shadow-map config (ShadowConfig), or null for no shadows.
castLight
Whether the light emits illumination (false = shadow-only).
lightChannels
Which channels (0–7) this light affects; a renderable is lit only if it shares an enabled channel. Channel 0 is the default.