This is an example of how to use vuer to render a scene in headless mode. Although we provide a vuer script, you should be able to use any vuer script with this setup. Just change the url in the src/index.ts file.
- First install
node
throughnvm
. - Install
yarn
- Install yarn and typescript globally, and tslint
npm install -g yarn typescript tslint
- now in project root run
This should install the needed modules under
yarn
node_modules
- For the python example, install vuer (v0.0.29rc and above)
pip install 'vuer[all]'
The example contains two scripts: a python script for launching the vuer server which also fires the rendering requests, and a puppeteer script that launches chrome in headless model, with GPU acceleration turned ON, to render the scene.
On macs we use the gl
mode angle
. On Linux, you might want to use egl
instead. I have not tested that.
run:
python python/vuer_example.py
then in a different shell run
yarn start
or
ts-node src/index.ts
To test if webgl is enabled, use puppeteer to visit https://use.webgl.org
.
Low frame rate: The frame rate is low for grabbing rendered images from the default camera. Not sure why.
Puppeteer waitFor...
trigger not idea: I am currenting using a leva className
as the trigger, but this is not idea. Need to find a better way to identify page
and app load.