Skip to content
pubscout

flutter_scene

0.24.3, released 6 weeks ago by bdero.dev

A 3D game engine for Flutter built on Flutter GPU with PBR lighting and glTF support.

WASM-ready
$ flutter pub add flutter_scene
Source repository

What it does

Renders 3D scenes, glTF models, and geometries with PBR lighting, shadows, physics, and animation using Flutter GPU. It runs on mobile, desktop, and the web, and includes a desktop scene editor and asset pipeline.

AI-written summary of version 0.24.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to build 3D games or interactive graphics experiences within Flutter.
  • You need glTF model rendering with PBR lighting and shadows across all Flutter platforms.

Skip it when

  • You only need standard 2D UI layouts and standard Flutter widgets.
  • You are running on Flutter versions that do not support Flutter GPU or you cannot enable it.

Strengths

  • Built on Flutter GPU for native-tier performance across mobile, desktop, and web.
  • Supports PBR materials, physics, positional audio, and skeletal animation.
  • Includes a build-time asset pipeline for optimization and a scene editor.

Weaknesses

  • Requires enabling Flutter GPU flags and specific platform setup.
  • Asset pipeline and shader compilation require build hooks.

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
16

Requires running `dart run flutter_scene:init`, enabling Flutter GPU in platform configuration files or command-line flags, and Flutter 3.47.1+ for some native targets.

import 'package:flutter/material.dart';
import 'package:flutter_scene/scene.dart';
import 'package:vector_math/vector_math.dart' as vm;

void main() => runApp(const MaterialApp(home: CubeView()));

class CubeView extends StatefulWidget {
  const CubeView({super.key});

  @override
  State<CubeView> createState() => _CubeViewState();
}

class _CubeViewState extends State<CubeView> {
  final Scene scene = Scene();
  bool ready = false;

  @override
  void initState() {
    super.initState();
    Scene.initializeStaticResources().then((_) {
      scene.add(
        Node(
          mesh: Mesh(
            CuboidGeometry(vm.Vector3(1, 1, 1)),
            PhysicallyBasedMaterial(),
          ),
        ),
      );
      if (mounted) setState(() => ready = true);
    });
  }

  @override
  Widget build(BuildContext context) {
    if (!ready) return const SizedBox.expand();
    return SceneView(
      scene,
      camera: PerspectiveCamera(position: vm.Vector3(2, 2, -4)),
    );
  }
}

Alternatives

Packages that do the same job and could replace flutter_scene.

  • flame

    If you want a mature 2D game engine with extensive component and ecosystem support.

Works with

Packages commonly used together with flutter_scene: ones it builds on, ones built on it, and its own family.