Filament
Thermion uses the Filament PBR package for much of the heavy lifting - rendering, materials, glTF, and so on.
Thermion is currently based on the v1.69.1 release of Filament.
Building your own materials
Section titled “Building your own materials”If you want to work with custom materials, you will need some basic knowledge of the underlying Filament library.
Things to keep in mind:
- Materials must be compiled against a Filament build with a matching material binary version. Filament’s material version is independent of the Filament release version, and not every release bumps it — so a material compiled for one release often still loads on the next.
- Thermion renders glTF assets through a single “uber” material archive (
.uberz) that is specialized at runtime via specialization constants (shading model, blending, and so on).
To rebuild the materials bundled with Thermion, from the repository root:
make materialsThis compiles the .mat sources under materials/ against your local Filament build (FILAMENT_PATH).
Footguns
Section titled “Footguns”Stripping in release mode
Section titled “Stripping in release mode”If you build your app in release mode, you will need to ensure that “Dead Strip” is set to false.
This is because we only invoke the library at runtime via FFI, so at link time these symbols are otherwise treated as redundant.
Animations when backgrounded
Section titled “Animations when backgrounded”Don’t call playGltfAnimation when the app is in the background (i.e. inactive/hidden). This will queue, but not start, an animation, and eventually this will overflow the command buffer when the app is foregrounded/resumed.
If you have a looping animation in your app code, make sure it pauses while the app is backgrounded.
Building Filament from source
Section titled “Building Filament from source”You normally don’t need to build Filament yourself — Thermion’s build hook fetches prebuilt binaries for every platform. If you’re modifying Thermion’s native code, see Web for building the WASM target locally.
