Environment

fun FilamentSceneScope.Environment(environment: Environment, intensity: Float, rotation: Rotation = Rotation.Identity, skyboxEnabled: Boolean = true)

Lights the scene with a loaded environment and draws its skybox, if it has one:

FilamentSceneView(cameraState = cam) {
Environment(rememberKtxEnvironment(
ibl = { Res.readBytes("files/environment/env_ibl.ktx") },
skybox = { Res.readBytes("files/environment/env_skybox.ktx") },
))
GltfInstance(asset = duck) // lit by the environment, no light needed
}

Shorthand for an IndirectLight plus a Skybox; declare those two yourself to set the skybox's own options. A scene has one of each, so declare one Environment per scene.

Parameters

environment

The loaded environment. The scene renders without it until its data arrives.

intensity

Environment intensity in lux.

rotation

Rotation of the lighting around the scene. Filament's skybox does not rotate with it.

skyboxEnabled

Draw the environment's skybox as the background. False lights the scene only.