Skip to content
Projekte

Über uns

Kotlin Multiplatform 3D graphics wrapper for Google's Filament engine, featuring first-class Compose Multiplatform integration across Android, iOS, Desktop, and Web.

Design und Medien

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
+1
in 7 days
+1
in 15 days
+2
in 1 month
+6

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

Filament KMP

Maven Central License Filament Kotlin Compose Multiplatform

Filament KMP brings Google's Filament physically based renderer to Android, iOS, Desktop and Web from one Kotlin API, with an optional Compose Multiplatform layer on top.

▶ Try the live web demo — every sample scene, in your browser.

The same scene rendering on Android, iOS, Desktop and Web
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") })
}
  • One API everywhere — the Kotlin API is written once in commonMain over a C API generated from Filament's headers, so it behaves the same on every platform.
  • Filament's own API — same classes, names and defaults as Filament's C++ API, so Filament's docs apply directly.
  • Compose optional — filament, gltfio, filament-utils and filamat are plain bindings: drive Engine / Renderer / SwapChain on your own surface, or render headless (guide).

[!NOTE] Unofficial project. A community-maintained wrapper, not affiliated with, endorsed by, or supported by Google or the Filament team.

Platforms

Platform Backend
Android (minSdk 24) OpenGL ES / Vulkan
iOS Metal
Desktop / JVM — macOS 11+, Windows 10+, Linux (glibc 2.38+) Metal / Vulkan / OpenGL, JDK 17+
Web (JS & Wasm) WebGL 2.0

Quick start

// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        mavenCentral()
        google()
    }
}
// build.gradle.kts
kotlin {
    sourceSets {
        commonMain.dependencies {
            // Compose integration (pulls in the engine), or just "…:filament:0.11.1" without Compose.
            implementation("io.github.erkko68.filament:filament-compose:0.11.1")
        }
    }
}

The same coordinates work on every target. Per-platform setup (iOS linking, Web prebuilts, Desktop natives) is in Getting Started.

Modules

Artifact Description
filament Core renderer — Engine, Scene, View, Renderer, Camera, Texture, Material.
filament-compose Compose Multiplatform integration — FilamentSceneView, scene DSL, camera state, post-processing.
gltfio glTF / GLB loading — AssetLoader, FilamentAsset, Animator.
filamat Runtime material compilation — MaterialBuilder.
filament-utils Camera manipulators, HDR/KTX loaders, math helpers.

All under io.github.erkko68.filament, one shared version. Coordinates and per-target dependencies: Modules.

Documentation

For engine concepts (PBR, lighting, materials), see Filament's own Engine and Materials docs.

Samples & showcase

License

Apache License 2.0. Filament itself is also Apache-2.0 licensed by Google.

Ähnliche Projekte entdecken

Wird geladen…