feat: add nemo-bevy crate for Bevy 3D embedding in GPUI#4
Open
feat: add nemo-bevy crate for Bevy 3D embedding in GPUI#4
Conversation
Implements a headless Bevy renderer on a background thread that sends RGBA frames to GPUI via ImageSource::Custom + RenderImage. Includes a custom render graph node (ImageCopyPlugin) for GPU texture readback, frame forwarding with RGBA/BGRA conversion, and input event bridging. - New crate: nemo-bevy with BevyRenderer, FrameData, LatestFrame types - New component: BevyScene with continuous repaint and mouse/scroll forwarding - Feature-gated behind `bevy` feature on the nemo crate - Default demo scene: spinning cube with directional light - Registered bevy_scene component with width/height schema Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
nemo-bevycrate implementing a headless Bevy 0.15 renderer on a background thread that streams RGBA frames to GPUI viaImageSource::Custom+RenderImageBevySceneGPUI component with continuous repaint (request_animation_frame), mouse move/click, and scroll wheel input forwardingbevyfeature flag on thenemocrate — existing builds are unaffectedArchitecture
New files
crates/nemo-bevy/— standalone crate withBevyRenderer,FrameData,LatestFrame,BevyInputEventcrates/nemo/src/components/bevy_scene.rs—BevyScene+BevySceneStateGPUI componentModified files
Cargo.toml— added member + dependencycrates/nemo/Cargo.toml— optionalnemo-bevydep +bevyfeaturecrates/nemo/src/components/{mod,state}.rs— cfg-gated module +ComponentState::Bevyvariantcrates/nemo/src/app.rs—get_or_create_bevy_state()+"bevy_scene"render armcrates/nemo-registry/src/builtins.rs— registeredbevy_scenewithwidth/heightschemaTest plan
cargo check -p nemo-bevy— standalone compilationcargo check -p nemo --features bevy— integration compilationcargo check -p nemo— existing build unaffected (no bevy feature)cargo test -p nemo-bevy— 4 unit tests pass (frame conversion, LatestFrame store/take/peek)cargo test -p nemo-registry— builtins registration test passes with new component<bevy_scene>and verify spinning cube renders in GPUI window🤖 Generated with Claude Code