GPU-accelerated 3D engine for Flutter. Renders through Rust + wgpu directly into an irondash native texture — zero pixel copies into Dart.
See the demo app — a Minecraft-style FPS sandbox.
| Layer | Tech |
|---|---|
| Rendering | wgpu (Vulkan / Metal / DX12), WGSL shaders |
| Physics | Rapier3D — rigid bodies, collisions, raycasting |
| Texture bridge | irondash — GPU buffer visible to Flutter, no copies |
| FFI | flutter_rust_bridge 2.12 |
git clone https://github.com/IILLUMINATION/flutter_3d_engine
cd flutter_3d_engine
flutter_rust_bridge_codegen generate
cd example && flutter run -d linuxfinal scene = await createScene();
final handle = await EngineContext.instance.getEngineHandle();
final id = await initNativeTexture(scene: scene, engineHandle: handle, width: 1280, height: 720);
final ctrl = Rust3DController.wrap(scene, textureId: id);
ctrl.initDefaultCamera();
void onTick(double dt) {
ctrl.physicsStep(dt);
renderNativeFrame(scene: scene, width: 1280, height: 720);
}
ctrl.spawnCubeInFront(r: 1.0, g: 0.27, b: 0.0);// Camera
controller.orbitCamera(dx, dy);
controller.movePlayer(dx, dz);
controller.jumpPlayer();
// World editing
controller.spawnCubeInFront(r: 1.0, g: 0.27, b: 0.0);
controller.destroyLookedBlock();
// Simulation
controller.physicsStep(dt);
// GPU texture
final id = await initNativeTexture(scene, engineHandle, width, height);
renderNativeFrame(scene, width, height);- An irondash texture is created — Flutter gets its ID, shows it with
Texture(textureId: id). - Rust spins up a wgpu device, renders the scene straight into that same texture. No pixels travel through Dart.
- Rapier3D steps the physics each frame. The camera rides on the player's rigid body.
- Raycasting finds the block under the crosshair. Surface normals snap placement to the grid.
| flutter_rust_3d | flutter_scene | |
|---|---|---|
| Physics | Rapier3D: rigid bodies, CCD, raycasting | None, manual |
| Flutter channel | Stable | Master only (experimental) |
| GC pressure | Rust heap, zero GC | Dart heap, scene graph in GC |
| Core portability | Standalone Rust crate | Locked to Flutter/Impeller |
| Rendering control | Raw wgpu shaders, instancing | Scene graph, glTF-first |
- Stable: rendering, physics, camera, block spawn/destroy, 31 unit tests
- Planned: pointer lock, textures, chunk generation, model loading
MIT — use it, fork it, build on it. Keep the copyright notice and attribution.
By IILLUMINATION.
