Environment
class Environment
A loaded image-based-lighting environment: the indirectLightState that lights the scene and an optional skyboxState background. Obtain via rememberKTXEnvironment (pre-baked KTX) or rememberHDREnvironment (raw .hdr) and feed the two states straight into io.github.erkko68.filament.compose.rememberFilamentScene:
val engine = rememberFilamentEngine()
val env = rememberKTXEnvironment(
engine,
ibl = { Res.readBytes("environment/env_ibl.ktx") },
skybox = { Res.readBytes("environment/env_skybox.ktx") },
)
val scene = rememberFilamentScene(
engine = engine,
skyboxState = env.skyboxState,
indirectLightState = env.indirectLightState,
) { ... }Content copied to clipboard
The states are returned immediately and populate asynchronously as the KTX data decodes — the scene simply renders without IBL/skybox until then. Both remain mutable afterward (e.g. env.indirectLightState.intensity = …, env.indirectLightState.rotation = …).