Running three.js by BabylonNative


I have a js library that draws some 3d objects written on three.js and I need to run this library as a desktop application. Is it possible to run in BabylonNative different from BABYLON.js WebGL libraries? Or maybe exists other solutions to do it without implementing DOM objects(Electron, Chromium)?

My understanding is no. In order to run with the back end being either OpenGL, Vulcan, or Metal, they are directly shimming to a library, Bgfx is the library Native uses to handle graphics. See BabylonNative/ at master · BabylonJS/BabylonNative · GitHub

In any case, there is no WebGL backend. While Apple has said WebGL is exempt from its OpenGL is depreciated statement, going directly at Metal or having Vulcan available is probably better. There are multiple versions of BABYLON.Engine, one called native engine which gets used for here. This precludes Three.js or any other framework running in BJS-Native.

1 Like

No, that’s not possible.
BabylonNative isn’t architectured and developped to be a browser replacement. bgfx isn’t wrapped to support webgl calls from JS. Wrapping is done at a higher level where babylonjs functions that use webgl and other browser functionnalities are replaced by a native version.
Like, for example, downloading a texture and loading the bits inside a webgl texture is all done at once.

1 Like

@JCPalmer, @Cedric
ok, I got it, thanks!