Build Configuration
Thermion’s native build is configured from your app’s pubspec.yaml under
hooks.user_defines.thermion_dart:
hooks: user_defines: thermion_dart: # ... any of the keys described belowMaterial backend variants
Section titled “Material backend variants”Set each built-in helper your app uses to true under materials. For
example, a transform gizmo needs gizmo: true and a background image needs
image: true. Apps that only render glTF assets with their authored materials
can omit the section.
For each enabled helper, the native build compiles shaders for the following backends by default.
| Platform | Default variant | Backends included |
|---|---|---|
| iOS / macOS | _apple |
Metal |
| Android | _android |
Vulkan + OpenGL |
| Linux / Windows | _desktop |
Vulkan + OpenGL |
If your app commits to specific backends, you can drop the others and shave
the unused shader code out of your binary with materials.backends:
hooks: user_defines: thermion_dart: materials: gizmo: true image: true backends: ios: metal android: [opengl, vulkan] linux: [opengl] windows: [vulkan]- OS keys:
ios,macos,apple(alias covering both),android,linux,windows. Each value is a backend name or a list. An OS you don’t list keeps its all-backends default from the table above. - Backends:
metalon iOS/macOS (the only option there);openglandvulkanon Android/Linux/Windows, individually or together. - Selecting a single backend means exactly that: a device that doesn’t support it will fail to render those materials — there is no fallback compiled in.
- For native WebGPU, set
backend: webgpu. A matchingmaterials.backendsentry takes precedence for the native material variant. - For the browser engine and its material variants, see Choose a backend.
Invalid configuration (a typo’d OS key, metal on Android, an empty list)
fails the build with an error naming the problem key.
Other keys
Section titled “Other keys”mode: debugandtracing: enabled— see Debugging.web_local: true— serve locally-built web artifacts instead of the prebuilt ones, see Web.skip_native_build: true— skip the native C++ build entirely (used when running pure-Dart tooling in this package).
Native error handling
Section titled “Native error handling”Thermion and the Filament libraries it ships use the same C++ build settings in debug and release: C++ exceptions are disabled. This avoids including C++ error recovery machinery that Thermion does not use. The size saving depends on the platform and has not yet been measured.
A Filament panic is fatal and stops the application. It cannot be recovered
through a Dart try/catch. Ordinary errors reported through return values
still work, as do Dart’s own exceptions and failed Futures.
Custom native plugins must use compatible build settings. Filament’s desktop
tools, such as matc and cmgen, run separately during development and retain
their own build settings; they are not linked into your application.
