IndirectLight

fun FilamentSceneScope.IndirectLight(reflections: Texture?, irradiance: SphericalHarmonics? = null, intensity: Float, rotation: Rotation = Rotation.Identity)

Image-based lighting for the scene: reflections drives specular highlights and irradiance the diffuse ambient light. Renders nothing while both are null (still loading). intensity and rotation are set on the live light, so animating them is cheap.

For a KTX or HDR file, Environment with rememberKtxEnvironment/rememberHdrEnvironment does this in one call; use this for textures or harmonics of your own.

rememberFilamentScene {
IndirectLight(reflections = envCubemap, irradiance = SphericalHarmonics(bands = 3, coefficients = sh))
}

A scene has one indirect light: declare one IndirectLight (or one Environment) per scene.

Parameters

reflections

Prefiltered reflection cubemap, or null for none.

irradiance

Diffuse irradiance as spherical harmonics. Null lets Filament approximate it from reflections.

intensity

Environment intensity in lux.

rotation

Rotation of the environment around the scene.


fun FilamentSceneScope.IndirectLight(reflections: Texture?, irradiance: Texture, intensity: Float, rotation: Rotation = Rotation.Identity)

IndirectLight with the diffuse irradiance as a cubemap instead of spherical harmonics.