FilamentView

fun FilamentView(scene: FilamentScene, modifier: Modifier = Modifier, cameraState: CameraState = rememberCameraState(), viewState: FilamentViewState = rememberFilamentViewState(), postProcessing: PostProcessing = PostProcessing(), frustumCullingEnabled: Boolean = true, shadows: Shadows? = Shadows.Pcf, screenSpaceRefractionEnabled: Boolean = false, stencilBufferEnabled: Boolean = false, transparent: 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 { DirectionalLight(); 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.

modifier

Modifier for the view's layout node.

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.

shadows

Shadow technique for the whole view (Shadows.Pcf/Shadows.Pcfd/Shadows.Vsm/Shadows.Dpcf/ Shadows.Pcss), or null to disable shadowing entirely. Per-light shadow-map quality is set via each light's shadow (io.github.erkko68.filament.compose.scene.ShadowConfig).

screenSpaceRefractionEnabled

Enable screen-space refraction for refractive materials.

stencilBufferEnabled

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

transparent

Enable alpha transparency blending for the view surface.