FilamentSceneView

fun FilamentSceneView(modifier: Modifier = Modifier, engine: Engine = rememberFilamentEngine(), cameraState: CameraState = rememberCameraState(), viewState: FilamentViewState = rememberFilamentViewState(), skyboxState: SkyboxState? = null, indirectLightState: IndirectLightState? = null, postProcessing: PostProcessing = PostProcessing(), frustumCullingEnabled: Boolean = true, shadows: Shadows? = Shadows.Pcf, screenSpaceRefractionEnabled: Boolean = false, stencilBufferEnabled: Boolean = false, transparent: Boolean = false, content: @Composable FilamentSceneScope.() -> Unit)

All-in-one entry point for the common single-view case: declares a scene and renders it through one viewport in a single call. Equivalent to a rememberFilamentScene feeding one FilamentView — reach for those directly when you need multiple views over one scene, or to hoist the scene as a value.

content is the scene declaration (lights, models, primitives); the viewport's look is configured by value via cameraState and postProcessing.

FilamentSceneView(
modifier = Modifier.fillMaxSize(),
cameraState = cam,
skyboxState = sky,
postProcessing = PostProcessing(bloom = Bloom(strength = 0.2f)),
) {
DirectionalLight(intensity = LightIntensity.LuminousPower(100_000f))
GltfInstance(asset = duck)
}

Parameters

modifier

Modifier for the view's layout node.

engine

Engine backing the scene. Defaults to a dedicated engine created and destroyed with this composable. Pass a rememberFilamentEngine value to share an engine.

cameraState

Hoisted camera state. The default constructs a new state.

viewState

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

skyboxState

Optional hoisted skybox state. Null = no skybox (the default).

indirectLightState

Optional hoisted IBL state. Null = no IBL (the default).

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.

content

Scene composables (io.github.erkko68.filament.compose.scene.DirectionalLight, GltfInstance, Group, primitives, …).


fun FilamentSceneView(engine: Engine, environment: Environment, 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, content: @Composable FilamentSceneScope.() -> Unit)

Overload wiring a loaded io.github.erkko68.filament.compose.scene.Environment (from rememberKTXEnvironment / rememberHDREnvironment) into the all-in-one view without threading its two states by hand. engine and environment are required and therefore lead the list — the engine must be the same one the environment's textures were loaded on. modifier keeps its place as the first optional parameter; all other parameters match the primary overload.