跪拜 Guibai
← Back to the summary

Flutter's 3D Rendering Landscape Splits Into Two Camps: Widget-First vs. Game-First

After yesterday's release of "Flutter's New True 3D Implementation: Building a 'Minecraft' with flutter_scene", many people wondered: has Flutter become a game engine? In reality, the main application scenario is not gaming, although it can indeed be used to make 3D games. For example, besides the bdero/flutter_scene mentioned yesterday that can build a 'Minecraft', there is another project called redstone_dart, which implements a Minecraft mod rewritten in Dart with a hot load feature:

In fact, the current application of 3D effects in Flutter is more like the following. Because it uses the same underlying rendering as Flutter, based on flutter_gpu, it can seamlessly render corresponding 3D models within the same memory:

GIF has some flickering because I dropped frames

This is actually the more useful scenario for 3D capabilities in Flutter right now. Of course, the image above uses another Flutter 3D rendering library, kiddo4/glint. Yes, yet another one.

*So although the official team hasn't promoted flutter_gpu themselves, the community has already produced many successful cases. Especially after Impeller finally added support for the Windows desktop, flutter_gpu has essentially completed its support for full-platform app scenarios.

This kiddo4/glint is also a Flutter-first 3D rendering engine, also based on flutter_gpu, rendering glTF/GLB models natively directly within the Widget tree. It's just more direct compared to bdero/flutter_scene:

It manages 3D scenes as ordinary Flutter state (setState to swap materials, Widgets anchored to model surfaces, etc.), while providing a backend-agnostic set of contracts for physics, animation, particles, and audio, combined with an optional native Box3D physics backend and a SoLoud audio backend to form a complete lightweight game engine.

The main implementation of kiddo4/glint's rendering core, GlintGpuFirstLight and GlintGameView (multi-instance game loop), is similar to:

Overall, kiddo4/glint is indeed much more lightweight than bdero/flutter_scene. After all, bdero/flutter_scene is really aimed at gaming.

So kiddo4/glint is a general-purpose scene graph setup. It can't make games, but it is more lightweight, belonging to the Flutter-widget-first category where scenes can be declared as Flutter state.

bdero/flutter_scene, on the other hand, is more heavyweight. Although it can also be implemented as a Widget, bdero/flutter_scene can conversely embed Flutter Widgets directly into a game, seamlessly:

For example, below are two animations of a freely controllable Dash that I easily added to a Flutter App using bdero/flutter_scene and kiddo4/glint:

demo

So, it's time to level up your Flutter App.

Links

https://glint.kiddobuild.dev/

https://fscene.dev/

https://github.com/Norbert515/redstone_dart

Comments

Top 1 from juejin.cn, machine-translated. The original thread is authoritative.

达达尼昂

Embedding a Flutter widget inside a game is wonderfully bizarre [thinking]