
Physically-based renderer wrapper exposing Filament engine with first-class Compose integration, scene DSL, glTF/GLB asset loading, runtime material compilation, camera state and value-based post-processing.
[!NOTE] Unofficial project. This is a community-maintained Kotlin Multiplatform wrapper around Google's Filament. It is not affiliated with, endorsed by, or supported by Google or the Filament team.
[!WARNING] Pre-release (
0.1.3-beta). This is pre-1.0 software and public APIs may still change between releases — the JVM bindings run on Project Panama (FFM, requires JDK 22+). Pin a specific version and read the release notes before upgrading.
Filament KMP brings the same physically based renderer that powers Android's Filament to iOS, Desktop/JVM, and Web (JS & Wasm), with first-class Compose Multiplatform integration.
FilamentSceneView(
modifier = Modifier.fillMaxSize(),
cameraState = rememberCameraState(eye = Position(0f, 1f, 4f)),
skyboxState = rememberSkyboxState(SkyboxSource.Color(Color(0.1f, 0.12f, 0.15f))),
postProcessing = PostProcessing(bloom = Bloom(strength = 0.2f)),
) {
DirectionalLight(direction = Direction(0.3f, -1f, -0.5f), intensity = 100_000f)
GltfInstance(asset = rememberGltfAsset { Res.readBytes("files/Duck.glb") })
}The world is declared in the content lambda; the viewport's look is configured by value. Need several cameras over one world? Hoist the scene with rememberFilamentScene { … } and feed it to multiple FilamentViews.
com.google.android.filament libraryjs and wasmJs targetsJVM requirements: the Android artifacts ship JVM 11 bytecode (minSdk 24) and work with the standard Android jvmTarget = 11 setup. The Desktop/JVM artifacts require JDK 22+ at build and run time — the FFM bindings call java.lang.foreign, finalized in JDK 22.
Add the Maven Central repository and depend on the modules you need:
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
}
}// build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.erkko68.filament:filament-compose:0.1.3-beta03")
}
}
}For the full setup (Compose Multiplatform plugin, FFM native runtime for Desktop, iOS framework linking, Web prebuilts) see Getting Started.
| Artifact | Description |
|---|---|
filament |
Core renderer — Engine, Scene, View, Renderer, Camera, Texture, Material. |
filament-compose |
Compose Multiplatform integration — rememberFilamentScene / FilamentView (and the FilamentSceneView shortcut), scene DSL, camera state, value-based post-processing. |
gltfio |
glTF / GLB asset loading — AssetLoader, FilamentAsset, Animator. |
filamat |
Runtime material compilation — MaterialBuilder. |
filament-utils |
Camera manipulators, HDR/KTX loaders, math helpers. |
All published under io.github.erkko68.filament. The Desktop/JVM bindings (Project Panama / FFM) ship as io.github.erkko68.filament-ffm:filament-ffm and are pulled in automatically, with the natives in per-platform filament-ffm-runtime-<os>-<arch> jars — all of them by default, or only your platform's if your build declares os/arch attributes (see java/README.md). See Modules for full coordinates and dependency graph.
The public API stays as close as possible to the Android Filament API, so existing Filament knowledge transfers directly. Differences:
get*() / set*() for single-value state accessors (e.g. view.scene, camera.focusDistance, engine.backend, engine.paused, engine.config). The boundary is deliberate: manager lookups that read as factory-ish accessors stay methods to match the Android Filament API — engine.getTransformManager(), getLightManager(), getRenderableManager(), getEntityManager() — as do calls that perform work or take arguments (engine.getFeatureFlag(name), engine.setActiveFeatureLevel(level)).Context or Android UI classes).Engine and friends remain accessible via FilamentEffect.FilamentSceneView / rememberFilamentScene / FilamentView, scene DSL, post-processing.matc reference.The samples/ directory contains a shared Compose scene running on all four targets. See samples/README.md for build commands.
The web build is also deployed live to erkko68.github.io/filament-kmp — open it on any WebGL 2.0–capable browser to try every scene without a local toolchain.
Licensed under the Apache License, Version 2.0. Filament itself is also Apache-2.0 licensed by Google.
[!NOTE] Unofficial project. This is a community-maintained Kotlin Multiplatform wrapper around Google's Filament. It is not affiliated with, endorsed by, or supported by Google or the Filament team.
[!WARNING] Pre-release (
0.1.3-beta). This is pre-1.0 software and public APIs may still change between releases — the JVM bindings run on Project Panama (FFM, requires JDK 22+). Pin a specific version and read the release notes before upgrading.
Filament KMP brings the same physically based renderer that powers Android's Filament to iOS, Desktop/JVM, and Web (JS & Wasm), with first-class Compose Multiplatform integration.
FilamentSceneView(
modifier = Modifier.fillMaxSize(),
cameraState = rememberCameraState(eye = Position(0f, 1f, 4f)),
skyboxState = rememberSkyboxState(SkyboxSource.Color(Color(0.1f, 0.12f, 0.15f))),
postProcessing = PostProcessing(bloom = Bloom(strength = 0.2f)),
) {
DirectionalLight(direction = Direction(0.3f, -1f, -0.5f), intensity = 100_000f)
GltfInstance(asset = rememberGltfAsset { Res.readBytes("files/Duck.glb") })
}The world is declared in the content lambda; the viewport's look is configured by value. Need several cameras over one world? Hoist the scene with rememberFilamentScene { … } and feed it to multiple FilamentViews.
com.google.android.filament libraryjs and wasmJs targetsJVM requirements: the Android artifacts ship JVM 11 bytecode (minSdk 24) and work with the standard Android jvmTarget = 11 setup. The Desktop/JVM artifacts require JDK 22+ at build and run time — the FFM bindings call java.lang.foreign, finalized in JDK 22.
Add the Maven Central repository and depend on the modules you need:
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
}
}// build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.erkko68.filament:filament-compose:0.1.3-beta03")
}
}
}For the full setup (Compose Multiplatform plugin, FFM native runtime for Desktop, iOS framework linking, Web prebuilts) see Getting Started.
| Artifact | Description |
|---|---|
filament |
Core renderer — Engine, Scene, View, Renderer, Camera, Texture, Material. |
filament-compose |
Compose Multiplatform integration — rememberFilamentScene / FilamentView (and the FilamentSceneView shortcut), scene DSL, camera state, value-based post-processing. |
gltfio |
glTF / GLB asset loading — AssetLoader, FilamentAsset, Animator. |
filamat |
Runtime material compilation — MaterialBuilder. |
filament-utils |
Camera manipulators, HDR/KTX loaders, math helpers. |
All published under io.github.erkko68.filament. The Desktop/JVM bindings (Project Panama / FFM) ship as io.github.erkko68.filament-ffm:filament-ffm and are pulled in automatically, with the natives in per-platform filament-ffm-runtime-<os>-<arch> jars — all of them by default, or only your platform's if your build declares os/arch attributes (see java/README.md). See Modules for full coordinates and dependency graph.
The public API stays as close as possible to the Android Filament API, so existing Filament knowledge transfers directly. Differences:
get*() / set*() for single-value state accessors (e.g. view.scene, camera.focusDistance, engine.backend, engine.paused, engine.config). The boundary is deliberate: manager lookups that read as factory-ish accessors stay methods to match the Android Filament API — engine.getTransformManager(), getLightManager(), getRenderableManager(), getEntityManager() — as do calls that perform work or take arguments (engine.getFeatureFlag(name), engine.setActiveFeatureLevel(level)).Context or Android UI classes).Engine and friends remain accessible via FilamentEffect.FilamentSceneView / rememberFilamentScene / FilamentView, scene DSL, post-processing.matc reference.The samples/ directory contains a shared Compose scene running on all four targets. See samples/README.md for build commands.
The web build is also deployed live to erkko68.github.io/filament-kmp — open it on any WebGL 2.0–capable browser to try every scene without a local toolchain.
Licensed under the Apache License, Version 2.0. Filament itself is also Apache-2.0 licensed by Google.