Skip to content

bdero/flutter_scene

Repository files navigation

Flutter Scene

Scene: 3D library for Flutter

Scene is a general purpose realtime 3D rendering library for Flutter. It started life as a C++ component of the Impeller rendering backend in Flutter Engine, and is currently being actively developed as a pure Dart package powered by the Flutter GPU API, with a built-in WebGL2 backend so it also runs on the web.

The primary goal of this project is to make performant cross platform 3D easy in Flutter.

Examples AppExample GameDocsFAQ


Flutter Scene

Flutter Scene

Flutter Scene

Flutter Scene

Flutter Scene

Early preview! ⚠️

  • This package is in an early preview state. Things may break!
  • Relies on Flutter GPU for rendering, which is also in preview state.
  • On native platforms this package requires Impeller to be enabled. On the web it runs on a built-in WebGL2 backend instead.
  • This package uses the experimental Dart "Native Assets" feature to automate some build tasks.
  • Given the reliance on non-production features, switching to the master channel is recommended when using Flutter Scene.

Features

  • glTF (.glb) asset import.
  • PBR materials.
  • Environment maps/image-based lighting.
  • Blended animation system.

FAQ

Q: What platforms does this package support?

On native platforms flutter_scene runs anywhere Impeller does. On the web it runs on a built-in WebGL2 backend.

On iOS and Android, Impeller is Flutter's default production renderer. So on these platforms, flutter_scene works without any additional project configuration.

On MacOS, Windows, and Linux, Impeller is able to run, but is not on by default and must be enabled. When invoking flutter run, Impeller can be enabled by passing the --enable-impeller flag.

On the web, no flags are needed; it works under both the CanvasKit and Skwasm renderers.

Platform Status
iOS 🟢 Supported
Android 🟢 Supported
MacOS 🟡 Preview
Windows 🟡 Preview
Linux 🟡 Preview
Web 🟡 Preview
Custom embedders 🟢 Supported

Q: How does web support work?

Impeller and Flutter GPU aren't available on the web, so flutter_scene ships a built-in WebGL2 backend (a drop-in for flutter_gpu) and renders through it there. It works under both the CanvasKit and Skwasm web renderers. Web support is new and in preview, so expect rough edges.

Repository

This repository is a pub workspace containing the library and the example apps:

Path Description
packages/flutter_scene The 3D rendering library, including the offline glTF importer and the web (WebGL2) backend. Published to pub.dev as flutter_scene.
examples/flutter_app Runnable example app exercising the library.
examples/flutter_gpu_shim_smoke Dev-only smoke test for the web backend.

To run the example app from a fresh clone:

flutter pub get                                             # resolves the workspace
flutter config --enable-native-assets                       # one-time setup

cd examples/flutter_app
flutter create . --platforms=macos,ios,android,linux,windows,web  # generate gitignored platform stubs
flutter run --enable-flutter-gpu --enable-impeller            # native; add `-d <device>` if needed
flutter run -d chrome                                         # web

About

3D library for Flutter.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors