Skip to main content

Overview

Filament can be installed via package managers for mobile platforms or built from source for desktop development. Choose the installation method that best fits your platform and use case.

Platform-Specific Installation

Android projects can declare Filament libraries as Maven dependencies. This is the easiest way to use Filament on Android.
1

Add Maven Central to your repositories

In your project’s build.gradle or settings.gradle:
build.gradle
repositories {
    mavenCentral()
}
2

Add Filament dependencies

In your app’s build.gradle:
app/build.gradle
dependencies {
    implementation 'com.google.android.filament:filament-android:1.69.4'
}
3

Initialize Filament in your app

Before using any Filament APIs, initialize the library:
MainActivity.kt
class MainActivity : Activity() {
    companion object {
        init {
            Filament.init()
        }
    }
}

Available Libraries

All libraries are in the com.google.android.filament group:
ArtifactVersionDescription
filament-android1.69.4Core Filament rendering engine
filament-android-debug1.69.4Debug version with validation
gltfio-android1.69.4glTF 2.0 loader (depends on filament-android)
filament-utils-android1.69.4KTX loading, Kotlin math, camera utilities
filamat-android1.69.4Runtime material compiler (large, includes full shader compiler)

Example: Full Stack

For a complete Filament setup with glTF loading and utilities:
app/build.gradle
dependencies {
    implementation 'com.google.android.filament:filament-android:1.69.4'
    implementation 'com.google.android.filament:gltfio-android:1.69.4'
    implementation 'com.google.android.filament:filament-utils-android:1.69.4'
}

Supported ABIs

The AAR contains binaries for all Android ABIs:
  • arm64-v8a (ARM 64-bit, recommended)
  • armeabi-v7a (ARM 32-bit)
  • x86_64 (Intel 64-bit)
  • x86 (Intel 32-bit)
ARM 64-bit (arm64-v8a) is the primary target and receives the most optimization. Use abiFilters in your Gradle configuration to include only the ABIs you need.

Filtering ABIs

To reduce APK size, filter specific ABIs:
app/build.gradle
android {
    defaultConfig {
        ndk {
            abiFilters 'arm64-v8a', 'armeabi-v7a'
        }
    }
}
Or use flavor dimensions:
app/build.gradle
android {
    flavorDimensions 'cpuArch'
    productFlavors {
        arm8 {
            dimension 'cpuArch'
            ndk {
                abiFilters 'arm64-v8a'
            }
        }
        arm7 {
            dimension 'cpuArch'
            ndk {
                abiFilters 'armeabi-v7a'
            }
        }
        universal {
            dimension 'cpuArch'
        }
    }
}

Binary Releases

Download Pre-built Releases

For desktop platforms, you can download pre-built binaries instead of building from source:
  1. Visit the Filament Releases page
  2. Download the archive for your platform
  3. Extract the archive
Release archives contain:
  • Host-side tools (matc, cmgen, filamesh, etc.)
  • Libraries for your platform
  • Header files
  • Sample applications
Always use tools from the same release as your runtime library. This is particularly important for matc (material compiler), as material formats can change between versions.

Essential Tools

Filament includes several command-line tools for asset preparation:

matc (Material Compiler)

Compiles material definitions into optimized shader packages:
matc -o output.filamat input.mat
Location after build: out/release/filament/bin/matc

cmgen (Cubemap Generator)

Generates image-based lighting assets from environment maps:
cmgen -x ./ibls/ -f ktx environment.hdr
Location after build: out/release/filament/bin/cmgen

filamesh (Mesh Converter)

Converts OBJ/FBX files to Filament’s native mesh format:
filamesh model.obj model.filamesh
Location after build: out/release/filament/bin/filamesh

gltf_viewer

A complete glTF 2.0 viewer for testing models:
gltf_viewer model.gltf
Location after build: out/cmake-release/samples/gltf_viewer
All tools support the --help flag to display usage information and available options.

Build Options

CMake Options

Filament supports several CMake options to customize your build:
OptionDescriptionDefault
FILAMENT_ENABLE_LTOEnable link-time optimizationsOFF
FILAMENT_BUILD_FILAMATBuild filamat and JNI bindingsON
FILAMENT_SUPPORTS_OPENGLInclude OpenGL backendON
FILAMENT_SUPPORTS_METALInclude Metal backendON (macOS/iOS)
FILAMENT_SUPPORTS_VULKANInclude Vulkan backendON
FILAMENT_SKIP_SAMPLESDon’t build sample appsOFF
To set an option:
cmake -DFILAMENT_ENABLE_LTO=ON -DFILAMENT_SKIP_SAMPLES=ON ..

build.sh Options

The build.sh script accepts several useful flags:
./build.sh [options] <build_type>
Common options:
  • -c: Clean build (removes out/ directory)
  • -i: Install to out/release/ or out/debug/
  • -p <platform>: Target platform (android, ios, webgl)
  • -q <abi>: Android ABI (arm64-v8a, armeabi-v7a, x86_64, x86)
  • -k <name>: Build specific sample (e.g., sample-hello-triangle)
  • -h: Show all available options

Example: Build Android Sample

./build.sh -p android -q arm64-v8a -k sample-hello-triangle release
Output APK: android/samples/sample-hello-triangle/build/outputs/apk/release/

Verifying Installation

Desktop (Linux/macOS/Windows)

After building, verify the installation:
# Check that tools are available
ls out/release/filament/bin/

# Should show: matc, cmgen, filamesh, and other tools

# Run a sample
./out/cmake-release/samples/hellotriangle

Android

Verify your Gradle dependencies:
./gradlew app:dependencies | grep filament
You should see:
+--- com.google.android.filament:filament-android:1.69.4

iOS

Verify CocoaPods installation:
pod list | grep Filament
You should see:
Filament (1.69.4)

Troubleshooting

Android: “Filament not initialized”

Make sure you call Filament.init() before using any Filament APIs:
companion object {
    init {
        Filament.init()
    }
}

Linux: Compiler errors with GCC

Filament requires Clang. Set the compiler explicitly:
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
export CXXFLAGS=-stdlib=libc++

macOS: Vulkan not found

Install the LunarG Vulkan SDK and enable “System Global Components”, then reboot.

Windows: CMake cannot find Visual Studio

Use the “x64 Native Tools Command Prompt” instead of the regular command prompt.

WebAssembly: CORS errors

Don’t open HTML files directly from the file system. Always use a local web server (emrun or live-server).

Next Steps

Quick Start

Build your first Filament application with the Hello Triangle example

API Reference

Explore the complete API documentation

Materials Guide

Learn how to create and compile materials

Samples

Browse example applications and code snippets

Build docs developers (and LLMs) love