Conversation
…or the 2D component tree
5 of 6 tasks
spydon
commented
Oct 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Screen.Recording.2026-10-01.at.18.15.36.mov
This adds
flame_3d_component, a bridge package for flutter_scene (the Flutter Scene engine by @bdero) that lets you put a 3D object into the regular 2D component tree of a Flame game.The package has one class,
Component3D. It is a plainPositionComponentthat holds a flutter_sceneSceneand aCamera, and draws the camera's view of the scene into its own size withScene.render. Everything else is Flame as usual: position, size, anchor, scale, angle, priority, children, and the regular update and render loop.This is deliberately not a 3D engine and not a replacement for one. All the 3D work (scene graph, cameras, materials, lighting, animation, model loading, physics) is done by flutter_scene. The package only draws a flutter_scene scene into a Flame component, which the README spells out. It is also separate from
flame_3d, which has a different purpose.Design notes:
dtfromupdateis accumulated and handed toScene.updateright before the scene renders, so pausing the game pauses animations and node components inside the scene, instead of flutter_scene falling back to its own wall clock tick.onLoadawaitsScene.initializeStaticResources, so subclasses can create meshes and materials aftersuper.onLoad().pixelRatiooverride exists.updateSceneandrenderSceneare protected hooks, so a subclass can useScene.renderViewsfor several cameras, and so the component is testable: flutter_scene'sSceneconstructor touches the GPU context and cannot be built underflutter test, so the scene is created lazily and the tests go through a recording subclass.ComponentandSprite, which clash with Flame's names.The example renders the animated KayKit skeleton (CC0, already in the repo) as a
Component3Dbetween aParallaxComponentin the camera backdrop and aSpriteAnimationComponentwalking across the viewport in front of it. It was verified as a web build, which needs no Flutter GPU flag. Native runs needflutter run --enable-flutter-gpu.Things to keep an eye on:
flame_3d*ignore glob already covers.Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?