Installation
Via npm
Install Filament.js from npm:Via CDN
Load directly from a CDN:Supported Backends
- WebGL 2.0
- WebGPU
Supported on all modern browsers:
- Chrome 56+
- Firefox 51+
- Safari 15+
- Edge 79+
Basic Setup
Creating Geometry
Create vertex and index buffers:Loading Materials
Load precompiled material files:Creating Renderables
Build a renderable entity and add it to the scene:Rendering Loop
UserequestAnimationFrame for the render loop:
Handling Window Resize
Update the viewport and camera projection:Complete Example
Loading Assets
Filament.init() can preload multiple assets:Memory Management
Manually delete temporary objects to avoid memory leaks:Module Bundlers
Using with Webpack, Rollup, or Vite:TypeScript Support
Filament includes TypeScript definitions:Performance Tips
Browser Support Matrix
| Browser | WebGL 2.0 | WebGPU | Status |
|---|---|---|---|
| Chrome 56+ | ✅ | ✅ (113+) | Full support |
| Firefox 51+ | ✅ | 🔶 Experimental | Full support |
| Safari 15+ | ✅ | 🔶 Experimental | Full support |
| Edge 79+ | ✅ | ✅ (113+) | Full support |
Next Steps
glTF Viewer
Load 3D models in the browser
IBL
Set up image-based lighting
Post-Processing
Add bloom, DOF, and tone mapping
Web Samples
View live demos