Running Babylon.js on a nodejs server with headless-gl


#1

I’m trying to get Babylon.js running on a nodejs server with headless-gl and was wondering if anyone has had any success doing something like this. What I’m ultimately trying to do is load a .gltf file, then run the render loop for a specified time while capturing the frames from the GL context. Since I’m running on a nodejs server, I don’t have access to the web browser APIs so I’m using the following to simulate a browser like environment:

  • jsdom for the DOM implementation
  • headless-gl for the WebGL implementation
  • node-canvas for Canvas support in jsdom

I have been bumping into a series of problems during the creation of the babylon.js engine and the load of the resources in the scene. I am hacking and slashing to get around some of these problems and have made some progress, but I’m wondering if anyone has success doing something similar. Are there settings that I can set on Babylon.js that remove the need for a browser like context (it doesn’t look like this is the case based on some of the Babylon.js code I have seen)? Are there other node modules that would work better for simulating the browser like environment?

Any help or feedback is appreciated.