← back to Quadrille Showroom
scripts/shot-clad-realgpu.mjs
27 lines
// Real-GPU headed screenshot of a SELECTED state — proves the off-thread clad path
// renders the walls right-side-up (CanvasTexture flipY) + the hero opens. Also a
// room-preview shot so the side/back clad walls fill frame for visual inspection.
import pw from '/Users/macstudio3/.npm-global/lib/node_modules/playwright/index.js';
const { chromium } = pw;
import { mkdirSync } from 'fs';
const OUT = '/Users/macstudio3/Projects/quadrille-showroom/recordings/slice3';
mkdirSync(OUT, { recursive: true });
const browser = await chromium.launch({ channel: 'chrome', headless: false, args: ['--use-angle=metal', '--ignore-gpu-blocklist', '--window-size=1440,900'] });
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto('http://localhost:7690/', { waitUntil: 'domcontentloaded' });
await page.waitForFunction(() => window._qh && window._qh.wingBoards && window._qh.wingBoards.length >= 50, { timeout: 25000 });
await page.waitForTimeout(3000);
// select a board → clad all 4 walls
await page.evaluate(() => { const wb = window._qh.wingBoards; window._qh.focusOnWing(wb[Math.floor(wb.length / 2) + 3]); });
await page.waitForTimeout(4000); // carousel + flip + clad load
await page.screenshot({ path: OUT + '/03-clad-selected-realgpu.png' });
// room preview so the clad SIDE/BACK walls fill frame for upside-down inspection
await page.evaluate(() => { if (window._viewmode && window._viewmode.set) window._viewmode.set('room'); });
await page.waitForTimeout(2800);
await page.screenshot({ path: OUT + '/04-clad-room-realgpu.png' });
console.log('shots written to', OUT);
await browser.close();