The commented flags here suggest that there’s been some experimentation with headless WebGPU rendering in the past but that that work is still incomplete.
I’ve tried headless rendering with puppeteer/WebGPU but only see a blank screen where the canvas should be, even when a GPU is available from chrome://gpu. Is the three.js test suite able to do this successfully?
Example code that results in a blank space in place of a canvas:
'use strict';
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
headless: 'new',
args: [
'--no-sandbox',
'--headless=new',
'--use-angle=vulkan',
'--enable-features=Vulkan',
'--disable-vulkan-surface',
'--enable-unsafe-webgpu',
'--enable-webgpu',
]
});
const page = await browser.newPage();
page.on('console', msg => {
console.log('console text:', msg.text());
console.log('console location:', msg.location());
});
await page.goto('https://webgpu.github.io/webgpu-samples/?sample=rotatingCube');
await page.screenshot({ path: 'screen.png' });
await browser.close();
})();