Run babylon.js using GPU in nodejs?

If I use the npm package gpu.js on my electron app, can I accelerate the speed and performance, and even include more things into the scene?

No, because Babylon has it own (optimized) way to use the GPU

1 Like

This will require replacing the math module with a GPGPU-optimized version. Will be hard to achieve without forking and recompiling the framework.

You can use this library to run your own calculations and provide it to your scene of course

1 Like

So could Babylon.js be boosted in performance to reach the quality and performance of games today such as Half-Life: Alyx (not gameplay wise, but performance and quality)?

The main problem is with WebGL, even WebGL2, which is quite limited compared to what you can do with OpenGL 4+ / DirectX 11+.

WebGPU should be a big step in the right direction, but it’s not to be expected any time soon (maybe not before the end of the year, and more probably later for a first usable version).

So at the moment, Babylon can’t run with full performance of the GPU? And WebGPU is aiming to accomplish that from what your saying. If that’s true, and I make a game from Babylon.js in electron, in the future, Babylon.js should be updated to increase the performance by using the GPU?

When WebGPU is out Babylon will support it as much as possible and so some area will benefit from additional performances (@sebavan is much more knowledgeable than me about this).

Also, (advanced) end users will benefit from it directly because compute shaders will be available (so you will be able to make some code run on the GPU instead of writing regular code for the CPU, meaning better performances).

Thank you for the clarifying, that will be amazing for some webgl games or games made in javascript. I did however find a WebGPU NPM Package but I don’t think I can use it combined with Babylon.js, so instead I’ll make my engine and upgrade it once WebGPU comes out.