FilamentView

fun FilamentView(scene: FilamentScene, modifier: Modifier = Modifier, cameraState: CameraState = rememberCameraState(), viewState: FilamentViewState = rememberFilamentViewState(), postProcessing: PostProcessing = PostProcessing(), frustumCullingEnabled: Boolean = true, shadowingEnabled: Boolean = true, screenSpaceRefractionEnabled: Boolean = false, stencilBufferEnabled: Boolean = false)

A viewport onto a FilamentScene. Each FilamentView owns one Filament View, Camera, Renderer, and platform surface, and renders the given scene through them. Place several FilamentViews — anywhere in your layout — to render one scene through different cameras and post-processing setups.

FilamentView is a leaf: the world is declared in rememberFilamentScene and the look of this viewport is configured by value (cameraState, postProcessing, the render flags). For imperative access (picking, raw View/Renderer) pass a rememberFilamentViewState.

val scene = rememberFilamentScene { Light(...); GltfInstance(duck) }
Row {
FilamentView(scene, Modifier.weight(1f), cameraState = cam1,
postProcessing = PostProcessing(bloom = Bloom(strength = 0.2f)))
FilamentView(scene, Modifier.weight(1f), cameraState = cam2)
}

Parameters

scene

The scene to render, from rememberFilamentScene. Supplies the shared engine.

cameraState

Hoisted camera state. The default constructs a new state per view.

viewState

Hoisted handle exposing the live View/Renderer and pick().

postProcessing

Per-view post-processing and render-quality configuration.

frustumCullingEnabled

Skip rendering of objects outside the camera frustum.

shadowingEnabled

Allow lights to cast and receive shadows.

screenSpaceRefractionEnabled

Enable screen-space refraction for refractive materials.

stencilBufferEnabled

Allocate a stencil buffer (required for stencil-based effects).