Installation
CocoaPods
Add Filament to your iOS project using CocoaPods:Podfile
Manual Installation
Alternatively, download the iOS release from GitHub Releases and link the frameworks manually.Available Subspecs
Filament’s CocoaPod includes several subspecs:| Subspec | Description |
|---|---|
filament | Core rendering engine |
filamat | Runtime material compiler |
gltfio_core | glTF 2.0 loading |
camutils | Camera manipulation utilities |
viewer | High-level glTF viewer |
ktxreader | KTX texture loading |
Backend Selection
Filament supports two rendering backends on iOS:- Metal (Recommended)
- OpenGL ES
Metal provides the best performance on modern iOS devices:Set the preprocessor macro:
Setting Up the View
Configure the layer class
Override the
layerClass property to specify the backing layer:FilamentView.m
Creating the SwapChain
Pass the layer to Filament when creating the SwapChain:- Swift
- Objective-C
Rendering Loop
UseCADisplayLink for the rendering loop:
Native C++ Integration
For maximum performance, use Filament’s C++ API directly:ViewController.mm
Handling Screen Resolution
Update the drawable size on rotation or resolution changes:Resource Management
Always clean up Filament resources:Platform Capabilities
| Feature | Metal | OpenGL ES |
|---|---|---|
| iOS Version | 11.0+ | 11.0+ |
| Performance | Excellent | Good |
| Feature Level | Up to 3 | Up to 1 |
| Status | Recommended | Deprecated |
Next Steps
glTF Viewer
Use the high-level viewer API
ARKit Integration
Combine Filament with ARKit
Materials
Create custom materials
Performance
Optimize for mobile devices