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. FilamentDithering.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, from rememberKtxEnvironment (pre-baked KTX) or rememberHdrEnvironment (raw .hdr). Place it in a scene with the Environment composable, or hand its parts to IndirectLight and Skybox yourself.
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.
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. QualityLevel.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.
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.
Lights the scene with a loaded environment and draws its skybox, if it has one:
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.
IndirectLight with the diffuse irradiance as a cubemap instead of spherical harmonics.
Image-based lighting for the scene: reflections drives specular highlights and irradiance the diffuse ambient light. Renders nothing while both are null (still loading). intensity and rotation are set on the live light, so animating them is cheap.
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's EquirectangularToCubemap and SpecularFilter.
Loads an IBL environment (and optional skybox) from KTX1 data, e.g. the pair Filament's cmgen bakes. Returns at once; the Environment's parts fill in as the data decodes. Failures (a loader throwing, or undecodable KTX) are reported once via onError and leave that part null.
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.
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 cubemap background for the scene, e.g. the Environment.skybox of a loaded environment or a cubemap of your own. Renders nothing while texture is null (still loading).
A solid-color background for the scene. The color is set on the live skybox, so animating it is cheap.
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.