Erkko68/filament-kmp
Erkko68/filament-kmp has 61 GitHub stars and 4 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-18 12:53 UTC. Last push 2026-11-18.
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Kotlin Multiplatform 3D graphics wrapper for Google's Filament engine, featuring first-class Compose Multiplatform integration across Android, iOS, Desktop, and Web.
Web & AppsREADME.md
OriginalFilament KMP
Filament KMP brings the same physically based renderer that powers Android's Filament to iOS, Desktop/JVM, and Web (JS & Wasm) — as a plain Kotlin Multiplatform library, with an optional Compose Multiplatform layer on top.
[!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.

FilamentSceneView(
modifier = Modifier.fillMaxSize(),
cameraState = rememberCameraState(initialEye = Position(0f, 1f, 4f)),
postProcessing = PostProcessing(bloom = Bloom(strength = 0.2f)),
) {
Skybox(color = LinearColor(0.1f, 0.12f, 0.15f))
IndirectLight(irradiance = SphericalHarmonics.NeutralStudio) // soft ambient, no file to load
DirectionalLight(direction = Direction(0.3f, -1f, -0.5f), intensity = LightIntensity.LuminousPower(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.
Not using Compose? filament, gltfio, filament-utils and filamat are plain Kotlin bindings with no Compose dependency — drive Engine / Renderer / SwapChain yourself against your own SurfaceView, CAMetalLayer, GLFW window or <canvas>, or render headless and read the pixels back:
val engine = Engine.create()!!
val swapChain = engine.createSwapChain(NativeSurface(myNativeWindow))
val renderer = engine.createRenderer()
if (renderer.beginFrame(swapChain, frameTimeNanos)) {
renderer.render(view)
renderer.endFrame()
}
See Using the Engine Without Compose.
Platform support
Every platform runs on one C API generated from Filament's C++ headers, and the Kotlin API is written once in commonMain on top of it, so the API and its behavior are the same everywhere:
- Android — OpenGL ES / Vulkan, over JNI (
libfilament-c.soper ABI) - iOS — Metal, direct Kotlin/Native calls into the C API
- Desktop / JVM (macOS, Windows, Linux) — Metal / Vulkan / OpenGL, over JNI (
libfilament-cper platform) - Web (JS & Wasm) — WebGL 2.0, the C API compiled to wasm with Emscripten (
filament-kmp.wasm)
JVM requirements: the Android artifacts ship JVM 11 bytecode (minSdk 24) and work with the standard Android jvmTarget = 11 setup. The Desktop/JVM artifacts need JDK 17+, like Compose Desktop.
Upgrading from 0.6.0? The API now follows Filament's C++ headers and the native runtimes changed on every platform; follow the migration guide.
Quick start
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 {
// Compose integration (pulls in the engine), or just "…:filament:0.9.0" without Compose.
implementation("io.github.erkko68.filament:filament-compose:0.9.0")
}
}
}
The same coordinates work on every target — Gradle resolves one variant per target you declare, so you don't download the platforms you don't build for. (The one exception: the Desktop/JVM natives default to all five desktop platforms; one snippet narrows them — see what Gradle actually downloads.)
For the full setup (Compose Multiplatform plugin, native runtime for Desktop, iOS framework linking, Web prebuilts) see Getting Started, and Modules for the per-target dependency table.
Modules
| Artifact | Description |
|---|---|
filament |
Core renderer — Engine, Scene, View, Renderer, Camera, Texture, Material. No Compose dependency. |
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 native runtime (filament-jni-desktop) is pulled in automatically, with the natives in per-platform filament-jni-runtime-<os>-<arch> jars — all of them by default, or only your platform's if your build declares os/arch attributes (see desktop/README.md). See Modules for full coordinates and dependency graph.
Versioning & stability
Releases are plain X.Y.Z:
X.Y.0(minor) — the normal release channel. New upstream Filament feature releases (1.73 → 1.74 → …) land here, along with new bindings and wrapper API additions. A minor may break API as described below; every break is listed in the changelog, with a guide in docs/migration when code has to change. When Filament bumps its material version, recompile your.filamatfiles with the matchingmatc.X.Y.Z(patch) — no API surface change: bug fixes in the wrapper, and upstream point releases picked up without binding anything new. Safe to pick up without reading anything.X.0.0(major) — reserved for maturity milestones and very large changes (a stabilized public API, a full architectural rework). Routine upstream tracking never triggers a major bump — expect minor releases to keep flowing for as long as Filament keeps releasing.
What may change
- The bindings (
filament,gltfio,filament-utils, …) follow Filament's C++ headers, so they change when upstream does: the minor that picks up a feature release carries its renames and removals. Beyond that they change only to match the headers more closely. filament-composecovers the common path (load a model, light it, frame it, tap it, animate it, capture it) and is mostly complete. Its API changes when a real pain point or a badly designed area turns up, from an issue, user feedback or our own use, and each change is kept small and focused.- Opt-in APIs — anything behind an
@Experimental…annotation (such as@ExperimentalGpuToGpuFrameSharing) is still taking shape and may change in any minor release.
All io.github.erkko68.filament:* artifacts share one version and must be upgraded together. The project is actively maintained long-term and tracks upstream Filament releases as they are published (see docs/internals/upgrading-filament.md for the process). Larger technical direction — like zero-copy GPU sharing with Compose — lives in the Roadmap.
API strategy
The public API follows Filament's C++ API, the one Filament's documentation and headers describe: the same classes, method names, owners and default values, on every platform. Adapted to Kotlin only where Kotlin has its own shape:
- Kotlin properties for getter/setter pairs and zero-argument getters (
view.scene,camera.focusDistance,engine.backend,engine.transformManager,engine.isPaused); calls that take arguments or do work stay methods (engine.getFeatureFlag(name),engine.setActiveFeatureLevel(level)). - Nullable results where C++ can fail (
Engine.create(),Material.Builder.build()),AutoCloseableon self-destroying types, overloads instead of per-type names (engine.destroy(view),engine.isValid(material)). - Nothing invented: no wrappers C++ doesn't have. Conveniences live in the optional Compose DSL, which keeps the raw
Enginereachable throughFilamentEffect.
How that API is produced, from C++ headers to a generated C API to Kotlin, is in The Generated C API.
Documentation
This project
- API Reference — generated KDoc for all published modules.
- Getting Started — per-platform Gradle setup, first scene.
- Modules — published artifacts, per-target dependencies, what Gradle downloads.
- Using the Engine Without Compose — own render loop, own surface, headless rendering.
- Platform Notes — backends, per-platform gotchas, web limits, desktop GPU frame sharing.
- Compose Integration — scene-vs-view model,
FilamentSceneView/rememberFilamentScene/FilamentView, scene DSL, post-processing. - Internals — for contributors: repository structure, the generated C API, native bindings, upgrading Filament, testing.
Upstream Filament (authoritative for engine concepts)
- Filament Engine — PBR theory, scene graph, lighting model, render pipeline.
- Materials — material system, surface shading model,
matcreference.
Samples
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.
Showcase
- HexonKMP — a larger sample app: a Catan-like strategy board game built with Filament KMP, running across platforms from a single codebase. Try the live web demo at hexon.biri.es.
License
Licensed under the Apache License, Version 2.0. Filament itself is also Apache-2.0 licensed by Google.