Files
workinf_Blender_Wasm/tools/web/probe-webgpu-caps.mjs
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

31 lines
1.6 KiB
JavaScript

#!/usr/bin/env node
/** Probe: is the WebGPU compute broker available in the embedded page? */
import { parseArgs, waitForServer, launchBrowser, newPage } from "./course/lib/lesson-recorder.mjs";
const args = parseArgs();
const BASE = `http://127.0.0.1:${args.port}`;
await waitForServer(`${BASE}/`);
const browser = await launchBrowser(args.gpu);
const { context } = await newPage(browser, { baseUrl: null });
const page = context.pages()[0] ?? await context.newPage();
await page.goto(`${BASE}/`, { waitUntil: "domcontentloaded" });
await page.locator("main.blender-app").waitFor({ timeout: 120_000 });
const caps = await page.evaluate(async () => {
const out = { hasNavigatorGPU: Boolean(navigator.gpu), crossOriginIsolated: globalThis.crossOriginIsolated };
try {
const mod = globalThis.Module;
out.hasModule = Boolean(mod);
out.hasCaps = typeof mod?.webGPUComputeCapabilities === "function";
if (out.hasCaps) out.caps = mod.webGPUComputeCapabilities();
} catch (error) { out.capsError = String(error?.message ?? error); }
try {
const adapter = navigator.gpu ? await navigator.gpu.requestAdapter() : null;
out.adapter = adapter ? (adapter.info ? `${adapter.info.vendor} ${adapter.info.architecture}` : "adapter") : null;
if (adapter) out.limits = { storageBuffers: adapter.limits.maxStorageBuffersPerShaderStage, workgroups: adapter.limits.maxComputeWorkgroupsPerDimension };
} catch (error) { out.adapterError = String(error?.message ?? error); }
return out;
});
console.log(JSON.stringify(caps, null, 2));
await context.close();
await browser.close();