rememberFilamentScene
Declares a Filament Scene as a value. The content lambda declares the world — lights, models, primitives, groups — via scene composables; it emits no UI and runs once at this call site regardless of how many FilamentViews later render the scene.
val scene = rememberFilamentScene(skyboxState = sky) {
DirectionalLight(intensity = LightIntensity.LuminousPower(100_000f))
GltfInstance(asset = duck)
}
FilamentView(scene = scene, cameraState = cam,
postProcessing = PostProcessing(bloom = Bloom(strength = 0.2f)))Parameters
Engine backing the scene. Defaults to a dedicated engine created and destroyed with this composable. Pass a rememberFilamentEngine value to share an engine.
Optional hoisted skybox state. Null = no skybox (the default).
Optional hoisted IBL state. Null = no IBL (the default).
Scene composables (io.github.erkko68.filament.compose.scene.Light, GltfInstance, Group, primitives, …). They are extensions on FilamentSceneScope.
Overload wiring a loaded Environment (from rememberKTXEnvironment / rememberHDREnvironment) into the scene in one argument, instead of threading its two states by hand:
val engine = rememberFilamentEngine()
val env = rememberKTXEnvironment(engine = engine, ibl = { … })
val scene = rememberFilamentScene(engine, env) { GltfInstance(asset = duck) }Parameters
Required here (no default): it must be the same engine the environment's textures were loaded on — a fresh default engine would mix resources across engines.
Loaded environment supplying both the skybox and IBL states.
Scene composables, as in the primary overload.