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

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.

1 Like

Hi Brentonator! Sorry for no replies. How is your progress on this? I wish you would have gotten some replies. (sniff) Maybe after this topic-bump… we will get more info.

We succeed in rendering server side with GitHub - GoogleChrome/puppeteer: Headless Chrome Node API

1 Like

Maybe have a look at the NullEngine() (Server Side - Babylon.js Documentation). Would that cover your use case? I have been successfully running a headless babylonjs on nodejs with it.