GeezerVison is showing github.com — feat(id-native-shell): Bevy scene renderer for scene/1 surfaces (#12657 step 2a) by dezren39 · Pull Request #13214 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Step 2a of #12657 (rich presentation surfaces): the Bevy scene renderer for the native shell. Step 1 of the contract is complete (scene 1a, audio 1b, widget 1c); this is the first of the three step-2 renderers. #12657 stays open on 2b (audio) and 2c (widget).
What lands
scene::SceneModel — the pure render model, mirroring render::ScreenGrid's separation: a host-validated SceneSurface becomes node models (shape, position, size carried through) plus the renderer's derived visuals, all in one testable place. The contract carries no visual fields beyond shape/position/size, so the derivation is defined here: a fixed hue family per shape, lightness stepped deterministically by the node id's FNV-1a hash, and a camera framing computed from the scene's bounds (centroid target, bounding-sphere standoff along a fixed direction).
scene::SceneRenderPlugin — reads the existing PresentedView resource (world input stays on the same contract frames; no new frame kinds): on each view-sequence change it despawns the old scene's nodes, reframes the camera, and spawns one entity per node — Mesh3d (cuboid / unit sphere scaled to extents / ground plane), MeshMaterial3d<StandardMaterial> in the derived color, Transform at the contract position. A non-scene view, or no view, clears the scene. The binary registers the plugin beside ShellRenderPlugin.
scene::example_scene — the deterministic example world for this surface: a small Harbor scene (water plane, dock box, buoy sphere, beacon point) exercising the whole closed shape set; the tests present exactly this document through the session-frame seam.
- bevy gains the
bevy_pbr feature (standard 3D materials) on the existing step-2 render wiring; no new system libraries (the crate compiles and tests in the stock pkgs/id dev shell).
Shells without the scene plugin are unchanged: ScreenGrid still presents a scene surface as its deterministic text projection, and a parity test in the new module pins that fallback.
Verification

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
… step 2a)
Step 2a of the rich-presentation follow-on: the native shell gains a
real 3D renderer for validated scene/1 surfaces, beside the text grid.
- scene::SceneModel: pure render model — node shape, position and
size carried through from the host-validated contract types;
colors derived deterministically (hue family per shape, lightness
stepped by the node id's FNV-1a hash); camera framing computed
from the scene's bounds.
- scene::SceneRenderPlugin: one mesh entity per node with
bevy_pbr standard materials, camera reframed per view; a
non-scene view (or no view) clears the scene entities. Shells
without the plugin keep presenting the scene's text projection —
a parity test pins that fallback.
- scene::example_scene: the deterministic example world's Harbor
scene, exercising all four shapes in the closed set.
- bevy gains the bevy_pbr feature on the existing step-2 render
wiring (no new system libraries).
Verification: cargo nextest run -p id-native-shell — 81/81 pass
(8 new scene tests); cargo fmt clean; clippy clean in the new
module. The full clippy-native-shell gate is currently red on
main for an unrelated id-store reason (filed as #13207).
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 15 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
92465a56-88b3-4582-b7e3-002521d0aa23
Commits
-
Reviewing files that changed from the base of the PR and between 095714b and 8bbb7f4.
Files ignored due to path filters: 1
-
pkgs/id/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 4
-
pkgs/id/crates/id-native-shell/Cargo.toml
pkgs/id/crates/id-native-shell/src/lib.rs
pkgs/id/crates/id-native-shell/src/main.rs
pkgs/id/crates/id-native-shell/src/scene.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-23T11:05:19.484795Z |
8bbb7f4 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bbb7f479d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
Self {
|
|
|
title: scene.title.clone(),
|
|
|
nodes,
|
|
|
camera_position: centroid + direction * (radius * 2.5),
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frame scene bounds using the viewport's aspect ratio
In sufficiently narrow portrait windows, valid scenes with horizontally separated nodes are clipped because the fixed radius * 2.5 camera distance never accounts for the viewport's narrower horizontal field of view. rebuild_scene only updates the camera transform, so resizing the window cannot correct the framing either. Derive the distance from the actual projection and viewport, and update it on resize. The existing camera test merely repeats the distance formula; a projection/frustum containment oracle across viewport ratios would catch this regression.
AGENTS.md reference: AGENTS.md:L37-L39
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
fn spawn_stage(mut commands: Commands<'_, '_>) {
|
|
|
commands.spawn((
|
|
|
SceneCamera,
|
|
|
bevy::prelude::Camera3d::default(),
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable tonemapping LUTs or select a LUT-free tonemapper
In the shipped binary, Bevy's Core3d plugin automatically adds the default TonyMcMapface tonemapper to this camera, but the crate disables default features and never enables tonemapping_luts. Bevy 0.19.1 substitutes a single magenta texel for the missing LUT, so scene meshes render magenta instead of retaining their derived colors and lighting differences. Enable the feature or explicitly attach a LUT-free tonemapper such as Tonemapping::Reinhard. The headless tests do not exercise this rendering path. See Bevy's camera registration and tonemapping implementation.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+287
to
+289
|
|
let sequence = presented.0.as_ref().map(|view| view.sequence);
|
|
|
if sequence == *last_sequence {
|
|
|
return;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebuild scenes when views change without advancing the world sequence
For worlds whose scenes change on host events such as time.tick or presence updates, this guard discards subsequent presentations because those events do not advance the durable world sequence. world/handle.rs:563-564 explicitly documents that behavior, and world_session/mod.rs:1422-1426 schedules fresh views from those notifications using the unchanged sequence. Consequently, animated scenes freeze after their first frame until a durable participant event occurs; a host-driven transition away from a scene also leaves its old entities visible. Track changes to the presented view or preserve and compare the host's view_revision instead of using only sequence.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|