feat(web): studio worlds, camera-view/offscreen environment parity, material and undo coverage
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

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>
This commit is contained in:
mes123456
2026-11-23 09:27:47 +08:00
parent f96654b158
commit 63db6caf1f
325 changed files with 20004 additions and 762 deletions

View File

@@ -23,18 +23,10 @@ test("M12-02G reclaims only the final project-scoped preview payload reference",
return commit.createAssetPreviewIdentity(input as never);
};
const identities = await Promise.all(base.assets.map((asset) => identityFor(asset.assetId)));
const open = (name: string): Promise<IDBDatabase> => new Promise((resolve, reject) => {
const request = indexedDB.open(name, 1);
request.onupgradeneeded = () => request.result.createObjectStore("setting", { keyPath: "id" });
request.onsuccess = () => resolve(request.result);
request.onerror = () => reject(request.error);
});
const complete = (transaction: IDBTransaction): Promise<void> => new Promise((resolve, reject) => {
transaction.oncomplete = () => resolve();
transaction.onerror = () => reject(transaction.error);
transaction.onabort = () => reject(transaction.error);
});
const seed = async (database: IDBDatabase) => {
const { openKvDatabase } = await import("/src/storage/opfs-kv.ts");
const open = (name: string) => openKvDatabase(name, ["setting"]);
const complete = (transaction: { done: Promise<void> }): Promise<void> => transaction.done;
const seed = async (database: Awaited<ReturnType<typeof open>>) => {
const transaction = database.transaction("setting", "readwrite");
transaction.objectStore("setting").put({ id: "asset-catalog:index:v2", value: base });
await complete(transaction);
@@ -94,9 +86,10 @@ test("M12-02G reclaims only the final project-scoped preview payload reference",
};
databaseA.close();
databaseB.close();
indexedDB.deleteDatabase(databaseAName);
indexedDB.deleteDatabase(databaseBName);
const root = await navigator.storage.getDirectory();
const kv = await root.getDirectoryHandle("_kv_v1");
await kv.removeEntry(databaseAName, { recursive: true });
await kv.removeEntry(databaseBName, { recursive: true });
const projects = await root.getDirectoryHandle("projects");
await projects.removeEntry(projectA, { recursive: true });
await projects.removeEntry(projectB, { recursive: true });