mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
The last part of #26: a full 3D video stepped React twice per frame, once in runtimes of its own to make the 3D rows beforehand and again for the page. When the page's render meets its first 3D frame, it now starts again with its 3D made live as each frame steps, as a game's render does. Each frame's scene is kept (LIVE_CLIPS) for the clipping check at the end, and --aov works on the live engine too. RAEA_3D=program keeps the old route. The program fallback's two returns are now one (render_bundle_with with scene.is_some()). This was parked until #38's cases matched (environment, kept mounts, text3d, volumetric glass, world answers, material fields: all landed). Checks with this build: - 190 compositions, default route vs RAEA_3D=program, 30 frames each: 151 identical. 35 fail on both routes as before (compositions that throw, plugins not compiled in). The three world cases differ on frame 0 only, which is expected (useWorldAnswer). bevy/paint differs on frame 10: two edge pixels by at most 15 levels. That is present without this change too (the previous build shows it on RAEA_3D=live) and is listed on #38. - #26's scene (bench/at-3d), full 360-frame render, whole run, old default vs new, back to back: 13.2/12.5/13.2 s vs 10.7/10.6/10.4 s, frame hashes identical. Its ms-a-frame line reads 24.0/24.1/25.5 vs 26.3/27.8/27.2, because React's one step is now counted inside the frame. - bevy-ts: 92 pass, 1 open (shader-character, open before too).
This commit is contained in:
1 parent
2a71a69d95
commit
b36c58f95d
2 files changed
+14
-6
No files matched your search
@@ -153,7 +153,7 @@ pub fn live_scene(world: &mut World, ls: &mut LiveScene, engine: &mut Option<rae
|
||||
None => {
|
||||
let clear = scene_clear(world);
|
||||
let p = ls.open(Shot { scene: &scene, clear: clear.as_deref() }, size.0, size.1, fps);
|
||||
let mut e = raea_render::engine::Engine::new_live(&p, &raea_render::inserted_of(&p), dir).map_err(|e| format!("the 3D didn't open: {e}"))?;
|
||||
let mut e = aov_on(raea_render::engine::Engine::new_live(&p, &raea_render::inserted_of(&p), dir).map_err(|e| format!("the 3D didn't open: {e}"))?);
|
||||
e.set_rows(&[])?;
|
||||
*engine = Some(e);
|
||||
}
|
||||
@@ -170,7 +170,6 @@ pub fn live_scene(world: &mut World, ls: &mut LiveScene, engine: &mut Option<rae
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
/// The Engine's reads (docs/sdk.feature S2d; off with RAEA_ENGINE_READS=0): the Engine stepped through frame f - 1 and its pushes sent before React
|
||||
/// is asked for frame f, so frame f's reads answer from frame f - 1's World in every render: a jump to f steps 0..f - 1
|
||||
/// first (it laid out f with no answer), and in order it's the frame already drawn, left as it was.
|
||||
@@ -253,6 +252,8 @@ pub(crate) fn render_fed(app: &mut App, js: &Path, w: u32, h: u32, fps: f64, tot
|
||||
fr = bevy_fed(app.world_mut(), bevy, cx, &page, fps)?;
|
||||
}
|
||||
}
|
||||
// a video's 3D made live keeps each frame's scene for the clipping check
|
||||
if LIVE_CLIPS.load(std::sync::atomic::Ordering::Relaxed) { fr.scene = scene_of(app.world_mut()); }
|
||||
if cx.scene3d.is_none() && cx.live3d.is_none() && !cx.scene.is_empty() && BEVY_3D_PROBE.load(std::sync::atomic::Ordering::Relaxed) {
|
||||
return Err(FED_3D.into());
|
||||
}
|
||||
|
||||
@@ -186,16 +186,23 @@ pub fn render_bundle(js: &Path, dir: &Path, out: &Path, wanted: Option<Vec<i64>>
|
||||
BEVY_3D_PROBE.store(false, std::sync::atomic::Ordering::Relaxed);
|
||||
if video && r.as_ref().err().is_some_and(|e| e.contains(FED_3D)) {
|
||||
raea_runtime_react::startup_mark("a 3D frame met: the render starts again with its 3D");
|
||||
if let Some(scene) = scene_program_checked(js, dir, 0, None)? {
|
||||
return render_bundle_with(js, dir, out, None, true, Some(scene), false);
|
||||
// its 3D made live as each frame steps, React once a frame (#26, #38); RAEA_3D=program makes its rows first
|
||||
if how != "program" {
|
||||
LIVE_CLIPS.store(true, std::sync::atomic::Ordering::Relaxed);
|
||||
let r = render_bundle_with(js, dir, out, None, true, None, true);
|
||||
LIVE_CLIPS.store(false, std::sync::atomic::Ordering::Relaxed);
|
||||
return r;
|
||||
}
|
||||
return render_bundle_with(js, dir, out, None, false, None, false);
|
||||
let scene = scene_program_checked(js, dir, 0, None)?;
|
||||
return render_bundle_with(js, dir, out, None, scene.is_some(), scene, false);
|
||||
}
|
||||
r
|
||||
}
|
||||
|
||||
/// The bevy_ui page's video render stops at the first frame with 3D (Err(FED_3D)), to start again fed with its 3D live.
|
||||
pub(crate) static BEVY_3D_PROBE: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
/// A video's 3D made live (not a game's): each frame's scene kept in its Frame for the clipping check at the end.
|
||||
pub(crate) static LIVE_CLIPS: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
|
||||
/// A game's bundle: it steps state with useGameState (bundles aren't minified, and what isn't used is left out).
|
||||
pub(crate) fn is_game(js: &Path) -> bool {
|
||||
@@ -374,7 +381,7 @@ pub(crate) fn render_bundle_with(js: &Path, dir: &Path, out: &Path, wanted: Opti
|
||||
}
|
||||
|
||||
/// An engine for the scene path, drawing the guide data when `--aov` asked for it.
|
||||
fn aov_on(mut e: raea_render::engine::Engine) -> raea_render::engine::Engine {
|
||||
pub(crate) fn aov_on(mut e: raea_render::engine::Engine) -> raea_render::engine::Engine {
|
||||
if AOV.load(std::sync::atomic::Ordering::Relaxed) {
|
||||
e.want_aov();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user