Package-level declarations
Types
Screen-space ambient occlusion (SSAO).
A weighted, auto-advancing blend of several glTF clips — a blend tree. Each AnimationTrack contributes its pose by AnimationTrack.weight; weights are normalized so they need not sum to 1.
Hoisted, observable playback state for a single glTF Animator, created with rememberAnimationState and passed to GltfInstance. It auto-advances on every frame and drives the animator each frame in one of two modes:
One weighted clip in an AnimationMixer, created with AnimationMixer.addTrack (or rememberAnimationTrack). Mutate weight to blend it in or out, index to swap the clip, or speed/loop for playback. The read-only time, progress and isFinished update every frame.
Hoisted, observable camera state. Create with rememberCameraState and pass to io.github.erkko68.filament.compose.FilamentView for full control over the camera.
Color grading — exposure, white balance, contrast, tone mapping, etc.
Depth-of-field (bokeh). The camera's focus distance and aperture control the focal plane.
Dithering applied at tonemap time. View.Dithering.TEMPORAL (Filament's native default) hides 8-bit banding in dark gradients and bloom halos.
Dynamic resolution scaling — lowers internal resolution under GPU load and upscales.
A loaded image-based-lighting environment: the indirectLightState that lights the scene and an optional skyboxState background. Obtain via rememberKTXEnvironment (pre-baked KTX) or rememberHDREnvironment (raw .hdr) and feed the two states straight into io.github.erkko68.filament.compose.rememberFilamentScene:
A loaded glTF asset whose GPU resources are ready. Obtain via rememberGltfAsset.
Scope for interacting with a specific glTF instance via low-level Filament APIs.
Hoisted, observable Image-Based Lighting (IBL) state. Pass to io.github.erkko68.filament.compose.rememberFilamentScene via indirectLightState = ....
Projection scaling — multiplies the projection along each axis. 2 on one axis zooms that axis in; unequal values give an anamorphic squeeze.
A light's brightness as a value type, bundling the amount with how it's interpreted — one variant per intensity setter on the core LightManager.Builder, so unit-specific extras (Watts' efficiency) are unrepresentable with the other units.
An RGB color (linear or sRGB depending on the consuming API). Distinct from the spatial vectors so a LinearColor can't be passed as a Position. Components are r/g/b.
Per-view visual configuration: post-processing effects plus render-quality options. Pass to io.github.erkko68.filament.compose.FilamentView via postProcessing = ....
Camera projection. Pass an instance as the Camera.projection argument.
Precision of the view's HDR color buffer. View.Quality.HIGH (the native default) is RGBA16F where supported — needed for emissive values above 1.0 to survive into bloom.
A 3-D rotation, stored as a unit quaternion. See Position for the rationale behind the distinct type — the same one applies doubly here, since filament-utils' Quaternion has mutable components and so is an unstable Compose input.
Screen-space reflections (SSR).
Per-light shadow-map quality, mapping onto the core LightManager.ShadowOptions. Pass a non-null shadow to a DirectionalLight/SunLight/SpotLight/FocusedSpotLight to make it cast shadows; null disables them. (Point lights cannot cast shadows.)
View-wide shadow technique, passed to a view via FilamentView(shadows = …) (or FilamentSceneView(shadows = …)). Each subtype is one of Filament's shadow algorithms and carries only the tuning that algorithm actually uses — so there are no silently-ignored fields. Passing null for the view's shadows disables shadowing entirely. See ShadowConfig for the per-light counterpart that sets each caster's map quality.
Source for a SkyboxState: either a solid color or a cubemap texture.
Hoisted, observable skybox state. Pass to io.github.erkko68.filament.compose.rememberFilamentScene via skyboxState = .... A null source removes the skybox entirely.
Spherical harmonics coefficients for diffuse irradiance.
Spot / focused-spot cone angles (half-angles in radians). innerAngle must be ≤ outerAngle.
The built-in materials shipped with filament-compose — precompiled .filamat blobs embedded in the library, so the common "colour a primitive" case needs no .mat authoring, no matc, and no asset shipping on any target (including Web, where runtime material compilation isn't available).
Tone mapping operator selection for ColorGrade, as a value: every variant compares structurally, so two ColorGrades built with the same settings are equal and don't force a ColorGrading rebuild (the native ToneMapper instances have identity equality, which would re-bake the grading LUT on every recomposition). The native operator is constructed only when the configuration is actually applied.
Functions
Attaches a CameraState to the surrounding Group so the camera follows that group's world transform every frame — a declarative chase / first-person / mounted camera.
A directional light — parallel rays from infinitely far (the classic "sun" for shading, without the visible disk; use SunLight for that). Only directional and spot lights can cast shadows.
A physically-correct spot light (LightManager.Type.FOCUSED_SPOT) — like SpotLight, but the outer cone angle affects total illumination (narrowing the cone concentrates the light). Can cast shadows. Parameters match SpotLight.
Places one copy of a GltfAsset in the scene.
Groups child scene composables under a single transform. Everything declared inside content is parented to a hidden transform entity, so moving/rotating/scaling the Group moves the whole assembly as a unit. Children's own position/rotation/scale become local to the group, and groups themselves nest cleanly inside other groups.
Low-level escape hatch: adds a light configured directly through the raw LightManager.Builder, for cases the typed composables (DirectionalLight, SpotLight, …) don't cover. You own the full builder; this composable only manages the entity, scene membership, and (when inside a Group) the transform so the light follows the group.
Creates and remembers a standalone AnimationMixer for imperative use — drive it from an OnFrame callback with the instance's Animator, mutating track weights from your own animation logic. Prefer AnimationState + rememberAnimationTrack for the declarative path.
The clip names of asset, indexed by animation index, or empty until the asset is ready. Look up an index by name — names.indexOf("Walk") — instead of hard-coding integers. Entries are null for unnamed clips.
Creates and remembers an AnimationState. The initial* values seed the state on first composition only; afterwards mutate the returned object's fields to drive playback.
Adds a weighted track to state's AnimationState.mixer for as long as this call stays in composition, and keeps its weight/index/speed/loop in sync with the arguments. The track is created once and removed automatically when the call leaves composition, so build a blend tree by calling this once per clip and driving weight from your own state. Its clock keeps running across index/weight changes; call AnimationTrack.seek to rewind.
Creates and remembers a CameraState.
A LIT PBR MaterialInstance tinted color, updated in place as the inputs change. Drop it straight into a primitive:
An UNLIT emissive MaterialInstance that glows: color tint scaled by intensity. Intensity above ~1 pushes past the bloom threshold and produces a halo (enable Bloom on the view).
Asynchronously loads a glTF/glb asset and keeps it alive as long as the calling composable is in the composition.
Builds an Environment from an equirectangular HDR image instead of pre-baked KTX — no cmgen step, just ship the .hdr. The reflection cubemap and skybox are prefiltered on the GPU at load via IBLPrefilterContext/EquirectangularToCubemap/SpecularFilter.
Creates and remembers an IndirectLightState. The initial* values seed the state on first composition only; mutate the returned state's fields to change the IBL afterwards.
Loads an IBL environment (and optional skybox) from KTX1 data and wires it into the scene's indirect-light/skybox state. This is the convenience path over hand-wiring KTX1Loader, texture lifetimes, and IndirectLightState/SkyboxState.
Creates and manages a MaterialInstance from a Material. The instance is destroyed when this leaves the composition.
Creates a MaterialInstance and (re-)applies configure declaratively — the imperative createInstance() + setParameter(...) + dispose dance done for you. The instance is built once per material; configure runs once on creation and again whenever any value in keys changes, so parameters track Compose state without an onUpdate/SideEffect. The instance is destroyed when this leaves the composition.
Creates and remembers a SkyboxState. The initial* values seed the state on first composition only; mutate the returned state's fields to change the skybox afterwards.
The shared base Material for a StandardMaterial, built on engine and kept alive for the lifetime of the enclosing rememberFilamentScene (one per engine + type, reused across call sites). Outside a scene — when engine is hoisted via rememberFilamentEngine — it builds a material owned by this call site and destroyed when it leaves the composition.
Asynchronously loads and manages a Filament Texture. Returns null while loading and on failure — it never throws inside composition. Pass onError to react when load throws (missing file, network error) or the bytes can't be decoded on this platform. See rememberMaterial for the engine-hoisting pattern when calling outside rememberFilamentScene { }.
A LIT MaterialInstance whose base colour is sampled from texture. Pair with a primitive (all built-ins supply uv0) or a io.github.erkko68.filament.compose.scene.primitives.Mesh with UVs.
A LIT PBR MaterialInstance tinted color with alpha transparency — the "make this object semi-transparent" case with no .mat authoring. Alpha is pre-multiplied by the shader and the material renders in two depth passes so convex primitives composite correctly with themselves.
An UNLIT solid-colour MaterialInstance — a flat color unaffected by scene lighting (HUD markers, wireframe-style fills, unlit gizmos).
Sets a float3 parameter from a LinearColor, keeping call sites typed against the colour value class.
A spot light — emits from position along direction within a cone, decoupling the outer cone from total illumination (easier to tweak than FocusedSpotLight). Can cast shadows.
A directional light that also draws a sun disk and halo in the sky (LightManager.Type.SUN). Same shading as DirectionalLight plus the visible disk configured by sun.
Convert a Compose UI androidx.compose.ui.graphics.Color to a scene-ready LinearColor, applying the sRGB→linear transfer. Alpha is dropped. Covers ARGB ints too, via Compose's own Color(0xFF2196F3) constructor.
Reinterpret a Float3 as a LinearColor (x→r, y→g, z→b).
Reinterpret a Quaternion as a Rotation.