Files
workinf_Blender_Wasm/docs/status/WEB-ENVIRONMENT-CAMERA-VIEW-20261122.md
mes123456 63db6caf1f
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
feat(web): studio worlds, camera-view/offscreen environment parity, material and undo coverage
Environment lighting:
- ship all eight desktop studiolights/world datasets (WBENV1 float32) and a
  shared loader used by both the main viewport and the offscreen worker
- add the N-panel "studio 环境" selector
- rotate the world background together with the environment
  (backgroundRotation/backgroundIntensity), so camera view and offscreen
  renders match the desktop Mapping-node behaviour

Verification (Chromium, OPFS, NOT_CLAIMED):
- environment lighting + 8 world pixel identity
- camera-view rotation correspondence (camera matrices, 207 samples)
- offscreen vs on-screen background parity after hiding geometry (1305 samples)
- metals case extended with material-field OPFS roundtrip
- material Principled edits and rename undo/redo
- eight studio worlds: pairwise frame differences + luminance rank correlation
- undo history depth capped at 64 steps and undo across OPFS save/reopen

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 09:27:47 +08:00

4.6 KiB
Raw Blame History

WEB-ENVIRONMENT-CAMERA-VIEW-20261122 status

  • case: WEB-ENVIRONMENT-CAMERA-VIEW-20261122(相机视图中的世界背景与环境旋转的一致性)
  • 类型:用户案例补缺(此前如实记录的剩余缺口:旋转在相机视图/离屏路径的应用、studiolight 与相机视角的对照);不是队列任务,未改动 docs/EXECUTION_QUEUE.md 与 nextTask
  • 改动文件(当前哈希):
    • web/tests/e2e/wbv2-environment-camera-view-production.spec.ts(b0492bc9…a573756,新增)
    • web/app/src/three-adapter/texture-assets.ts(96b1fe34…0ac74b73e3,applyEnvironment 同步 backgroundRotation/backgroundIntensity)
    • web/app/src/three-adapter/viewport.ts(f876c479…17a43f0,Scene World 背景绘制 + window.__webViewportCamera 发布)
    • web/app/src/three-adapter/studio-environment.ts(f2e4014f…09c1b7a4,主视口/离屏共用加载器)
    • web/app/src/three-adapter/offscreen-viewport.ts(5e5409b1…cd62a3e8)、offscreen-viewport-protocol.ts(c3d83f89…b57b7609,新增 studioLight 请求)
    • web/app/src/workers/viewport-render.worker.ts(c5955b75…146952c5,离屏应用 studio 环境与旋转)
  • 源码依据:桌面 World 旋转是 Mapping 节点接入 Environment Texture 的 Vector,背景与 EEVEE 照明消费同一张环境图,因此旋转必须同时作用于 scene.environmentRotation 与 scene.backgroundRotation(含相机视图与离屏出图路径)。
  • 流程(全部经产品入口,fixture tests/files/web/basic_scene.blend):
    1. 打开 .blend,等 SceneIR rN;勾选「场景世界」→「世界环境」面板;
    2. 加载并选择 m12_obj_texture 作为环境贴图,强度 1、旋转 0,等 data-ibl-status=ready;
    3. 点「相机视图」,等到 window.__webViewportCamera(matrixWorld 列主序、fov/zoom/aspect/width/height);
    4. preserveDrawingBuffer 抓取帧 A(rotation 0);
    5. 环境旋转 90°,等到快照 environmentRotation≈π/2 且画面像素发生变化,抓取帧 B;
    6. 在页面内用相机矩阵把 B 帧天空区(顶部 2%–30% 行网格,步长 17/23)的像素方向按 ∓θ 绕 Y 反旋转,再投影回 A 帧采样;匹配判据为三通道平均差 ≤ 10。
  • 结果:1 passed (35.7s)
    • 采样 207 点,匹配率 1.0(matchingRotationSign = -1),反向符号仅 0.2609 —— 背景严格随世界旋转,方向与 three.js backgroundRotation 语义一致;
    • 证据:tests/golden/WEB-ENVIRONMENT-CAMERA-VIEW-20261122/camera-view.json。
  • 同时覆盖(相邻缺口):web/app/public/lights/ 补齐桌面 studiolights/world/*.exr 全部 8 个数据集;wbv2-environment-lighting-production.spec.ts 逐一选择 8 个 studio 环境并断言 pixelsSha256 与各自 manifest 全等(1 passed (8.9s))。
  • 过程中修复:用例最初在设置「环境旋转 = 0」后轮询失败 —— range 控件默认值即 0,React value tracker 去重后不触发 onChange,快照因此从不写入 environmentRotation。改为把“字段缺失”也视为 0(与 UI 语义一致),不新增写入口。
  • 2026-11-22 增补:离屏(?offscreen=1)出图路径的逐像素对照
    • 用户指出 basic_scene.blend 自带的正方体会遮挡/干扰比较;用例改为先经 Outliner 逐行「隐藏 <名称>」隐藏所有 MESH,等快照中无可见 MESH 后再进入相机视图,只比较世界背景。
    • 同一测试内依次采集:屏内 0°、屏内 90°、屏内 −90°、离屏 0°、离屏 90°(两模式各自重新打开 fixture,画布同为 989×613)。
    • 结果:离屏 90° 与屏内 90° 的天空区 NDC 网格(1,305 点,差阈值 12/255)匹配率 1.000,与 0° 基准同样 1.000;离屏 0°→90° 变化率 0.8398;离屏 90° 对屏内 −90° 仅 0.202,方向唯一。证据 tests/golden/WEB-ENVIRONMENT-CAMERA-VIEW-20261122/camera-view-offscreen.json 及 offscreen-*.png/onscreen-rotation-0.png。
    • 过程修正:最初比较代码误用离屏 0° 帧去比屏内 90° 帧,导致 0.44 的假不匹配;改为同角度帧比较后为 1.000。
  • 未验证 / 剩余缺口:
    • 相机视图对照是“自一致/跨后端”校验,不是与桌面渲染的逐像素比对;
    • 除 forest 外的 7 个 studio 世界只验证了像素数据集身份,未做光照效果目视对照。
  • 验收:NOT_CLAIMED(单 case 通过是证据素材,不等于整体验收)。
  • 下一动作:如需继续,补桌面渲染逐像素对照,或对 7 个非默认 studio 世界做目视/光照对照。