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>
31 lines
1.6 KiB
JavaScript
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();
|