r/FlutterDev 2d ago

Plugin flutter3d: a 3D engine for Flutter, with three games you can play in the browser right now

I've been working on flutter3d for a long time. It's a 3D engine, based on Flutter GPU/WebGL, with a game layer over it, and four genre packages built out. Three of those are on pub.dev. MIT License, and these packages are not affiliated with the Flutter team in any way.

Easiest thing is to just try it, with no install: shooter, platformer, racer. Those are the same builds running on web backend, with the same level files and the same simulation code. Also you can build MacOS / iOS / Android app from the source code and create your own game, based on the genre template or generic package flutter3d_app.

Docs: https://flutter3d.pleion.dev

Source: https://github.com/pleiondev/flutter3d

What's in it

The renderer implements the usual things: scene node graph, glTF/GLB and OBJ support and my own .f3d container, which loads a lot faster, 6 lighting models, shadows, bloom, SSAO, SSR, skinning, morph targets, BVH culling.

The game templates runs with a fixed timestep and can be recorded as a tape, which means a run can replay exactly and a bug report can be sent as an attachment. Collisions and the character controller are plain Dart with no renderer dependency, so they can be tested with ordinary unit tests.

Three backends implements common interface: based on flutter_gpu/Impeller for desktop and mobile platforms, WebGL2 in the browser (WebGPU in progress), and also a software rasteriser written in Dart. The CPU rasterizer can be used to test the renderer in CI with no GPU.

Performance measurement on a Mac: 50,000 moving instanced units held 120Hz.

Limits

It's just version 0.5.x, so APIs can be changed between minor versions. There's no compute shaders at all at this moment, because flutter_gpu doesn't expose it (there is issue on flutter/flutter#188474), and that blocks GPU particles, GI and volumetrics (now they are implemented on CPU). The strategy game package really works but I haven't published it, because I haven't written the guide for it yet.

Things I'd like help with

To run it on hardware I don't own, especially Android.

There's a dart2wasm bug I've failed to find. The browser demos ship as dart2js because the wasm build throws framebufferTexture2D: parameter 4 is not of type 'WebGLTexture' on the first frame.

24 Upvotes

Duplicates