feat(viewport): v1.0 B1 — render host 实时视口切引擎(看+转相机)#39
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…system Enable BabylonRenderHost to inject a real Engine while preserving default headless NullEngine behavior. Scene now uses right-handed coordinates to match three.js / glTF conventions. All ownership and dispose semantics preserved. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
….0 B1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…era + render loop
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mounting ThreeViewport while a selection is already in the store (engine switch back from Babylon, v1.0 B1) ran the initial syncSelection against an empty adapter — seedScene had not resolved yet — so gizmo/outline never appeared, and re-picking the same node is a store no-op that never re-fires the subscription. Latent pre-B1: every previous mount path had a null selection. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <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.
What
IRenderHost契约(src/runtime/render-host.ts,B1 子集:mount / 渲染循环 / 相机 / resize / dispose)+isEngineEditingCapable能力门(B2/B3/B4 在一处放开能力)。BabylonAdapter构造可注入引擎(默认仍NullEngine,conformance/headless 零改动)+scene.useRightHandedSystem = true(对齐 three/glTF 右手坐标系,真渲染无 z 镜像)。BabylonRenderHost:真Engine+ArcRotateCamera(构图对齐 Three 编辑器相机 [4,3,4]/fov50°)+ 渲染循环;dispose 链 stop → camera →adapter.dispose()(engine 所有权在 adapter)。BabylonViewport:镜像 ThreeViewport mount-effect 约定(dep 仅 project id);种场景/增量同步走新引擎中立纯函数diffSceneNodes(src/ui/viewport/scene-diff.ts);单节点 sync 失败 warn-skip 不拉黑视口。Viewport包装组件 + 视口工具栏EngineTogglepill(useUIStore.viewportEngine会话态;切换强制退 play,防 play 残留卡死右栏)。isEngineEditingCapable禁用;hierarchy 选中与面板编辑保持可用且实时同步。ThreeViewport.tsx一行未改(「并行+定接口」策略;B2/B3 按 A1 spec §8 边界清单收敛)。Why
design/framework/architecture.md§7 v1.0(多运行时适配器;实时切换渲染引擎是平台战略目标)docs/superpowers/specs/2026-06-10-v1.0b1-render-host-design.md· Plan:docs/superpowers/plans/2026-06-10-v1.0b1-render-host.mdBabylonAdapterheadless 契约成立;B1 让用户第一次在实时视口看到第二引擎渲染同一场景。How to test
pnpm lint && pnpm typecheck && pnpm test(545 tests,含 conformance 双引擎 + 新增 scene-diff/render-host/BabylonViewport/Viewport/EngineToggle/禁用面用例)pnpm tauri dev视觉 smoke:已跑 headless 视觉 smoke(vite dev 前端 + headless Chrome CDP 驱动,diff 为纯前端故 surface 等价):上述各项全过(滚轮缩放因 CDP quirk 未实测,orbit 已证);两个已记录的非阻塞观感 gap(Babylon 底色比 Three 暗——Three OutputPass sRGB 提亮、Babylon 直写 raw;Babylon 光强偏亮)已入 roadmap B4。
🤖 Generated with Claude Code