What happens if I take a powerful 3D web engine like Babylon.js and host it inside a native desktop or mobile app? A Babylon Native app of course!
This is not a Progressive Web App where a web page is hosted in a native app. One big difference is that there is no HTML DOM. The engine layer of Babylon.js is shimmed directly to the rendering layer native to the platform without going through WebGL. It is similar to how React Native is to React but for 3D rendering.
We started experimenting with this idea recently to see how viable it is.
What was the motivation?
- Lower the cost of developing and maintaining multiple cross-platform rendering engines
- Increase consistency and conformity of glTF rendering across various products
Here is what a Babylon Native application looks like right now.
What about shaders?
We are currently using a subset of ANGLE to transpile GLSL to HLSL for DirectX. We are still determining what happens for other rendering APIs.
[Update: We are now using glslang and SPIRV-Cross to do this.]
But even without all the platform abstraction flushed out, we already have an interesting product. We can already load all of the glTF 2.0 sample models and most of the glTF asset generator test models with a test app targeting either Win32 or UWP with Chakra or V8.
[Update: We have switched from an internal rendering engine to bgfx and are actively working on bringing back all the features including UWP support.]
We anticipate that the frame rate will match or exceed what a browser can do.
Since this started as an experiment, there are also a bunch of infrastructure pieces to implement, like the build system, test framework, etc. We have these in the backlog and will flush them out.
Why blog about this?
We want to have open discussions and get some early feedback. Is this useful? Is there something we are missing? We look forward to discussing this!
Gary Hsu — Babylon.js Team