Skip to content

StageFlow v1.1.1 — Diorama Performance, Camera Snap, Render Sync & Custom Export Range

Choose a tag to compare

@taruma taruma released this 14 Nov 09:18
· 40 commits to main since this release
7589e7e

StageFlow v1.1.1 is a focused reliability, performance, and exporter usability patch on top of v1.1.0. It eliminates idle WebGL/CPU churn when paused, resolves 60fps/10Hz shot-boundary desync glitched frames, fixes Observer Camera snap resets across score transitions and hydration, and adds a Custom (s) dual-handle timeline scrubber to the in-browser WebCodecs MP4 exporter.


What's New & Fixed in v1.1.1

⚡ Idle WebGL/CPU Loop Elimination, Memoized Rigs & 60fps Shot-Cut Sync Gate (#9 / PR #11)

  • On-Demand Canvas Rendering: Both DioramaCanvas and StageCamMonitorCanvas now run frameloop="demand" while paused, waking immediately on orbits, resize transitions, preset snaps, async <Text> font loads, and manual seeks (onSeekSettled / onTimeJump), while short-circuiting redundant idle computeStageFrame() calls.
  • Rig & Mannequin Memoization: Memoized DirectionalMannequin, BlueprintFloorGrid, and StageCameraRigMount, hoisted static arrays and unconditional hooks, delta-guarded DOM/GPU tether buffer updates (StageBillboardLabel, StageCameraFocusRig, StageCameraOffsetTether), added Three.js .dispose() resource cleanups, moved frame-invariant thin-lens DoF denominator math to CPU (uOpticalScale), and throttled MP4 export progress flushes (~100ms).
  • Shot & Cue Boundary Sync Gate (stageSyncGate.ts): Added resolveGatedState() with useLayoutEffect synchronization across gated rigs, mannequins, focus/offset tethers, mounts, and the WebGL2 DoF pass to hold the last rendered 60fps state across async boundary commits instead of snapping back to stale 10Hz uiFrame snapshots.

✂️ Custom Time Range (Custom (s)) & Dual-Handle Scrubber for MP4 Export (#13 / PR #14)

  • Shot-Aware Dual-Handle Scrubber: Extended Time Range in File ▾ → Export Video (.mp4)... with Custom (s), featuring a drag-only dual-handle timeline scrubber (ExportRangeScrubber / ExportRangeScrubberTrack) with shot cut dividers, hover timecode readout, and inline decimal Start (s) / End (s) inputs (0.1s step, preserving 3-decimal scene durations such as 45.375s and 61.625s).
  • Validation & Range-Tagged Output Filenames: Pure Layer 1 validation (validateCustomExportRange in src/core/exportMath.ts + src/core/exportScrubberMath.ts) guards against negative, inverted, out-of-bounds, or sub-frame (< 1 / fps) selections, while formatExportMp4Filename() emits _<start>s-<end>s_ tags (e.g., vector_field_2_5s-6s_stage_cam_1080p_60fps.mp4).

🎯 Observer Camera Snap & Clock Reset on Score Transitions (#8 / PR #15)

  • Deterministic sceneResetSeq Transition Signal: Opening, creating, forking/duplicating, deleting (fallback), resetting, importing, or asynchronously hydrating a score (IndexedDB, ?score=, ?remoteUrl=) atomically resets cameraMode to 'scripted', pauses and seeks the clock to t = 0, clears stale shotId gate refs, flushes residual OrbitControls damping deltas, and snaps the Observer Camera cleanly to frame.observerCamera.transform.
  • Non-Disruptive Live YAML Editing: Added MediaClockDriver.setDuration() in-place updates (Html5MediaDriver, YouTubeMediaDriver, ProceduralMediaDriver) so live YAML edits and in-place renames preserve playhead t, playback state, and paused free-orbit camera angles.

Quality & Verification

  • Unit Test Suite: 258 deterministic tests passing across 22 Vitest suites (tests/unit/stagePerfHelpers.test.ts, tests/unit/exportScrubberMath.test.ts, expanded exportMath.test.ts, and mediaDrivers.test.ts).
  • Static Checks: oxlint (0 warnings / 0 errors), strict TypeScript tsc -b, and Vite production build clean.

Upgrade & Usage Notes

  • Backward Compatibility: All v1.1.0 and v1.0.0 YAML choreography scores remain 100% compatible without changes.
  • Note on Issue #10: The proposed half-resolution DoF shader refactor (#10) was evaluated and closed as not planned after #9 resolved interactive stutter and idle GPU churn without introducing multi-pass FBO edge cases.

Full Changelog & Documentation


What's Changed

  • perf(stage,media,hooks): eliminate idle diorama churn, memoize rigs, and fix shot-cut desync (#9) by @taruma in #11
  • feat(export): add custom time range in seconds to in-browser MP4 export (#13) by @taruma in #14
  • fix(camera): snap observer camera to initial pose on score load, create, fork, and hydration (#8) by @taruma in #15
  • StageFlow v1.1.1 — Diorama Performance, Camera Snap, Render Sync & Export Custom Range by @taruma in #12

Full Changelog: v1.1.0...v1.1.1