About BabylonNative and Babyloncpp

So it seems that there’s a lot of effort being put by the core team of Babylonjs into achieving higher performance and their solution seems to be Babylon Native. The thing is, you can only go so far with having your core engine written entirely in javascript/typescript, so my question is why not also officially support Babyloncpp, a Babylonjs port to C++, if we really want to achieve high performance? It seems to be a much better solution, given the way they are approaching Babylon Native, I believe that it would be much better to have those resources allocated to Babyloncpp. I don’t see any downsides in Babyloncpp given that you would still be able to run your projects on the web by using WebAssembly.

Currently Babyloncpp is being developed by a single guy and the last time there was any post about it was 2 years ago in the old forum, while the latest youtube video about it was in november 2019, latest commit was today. It is in the stable version of 3.3 and being developed to the Babylonjs 4.0 version. I wish he could get some help.

Hello and welcome!

Well this is not exactly the goal :slight_smile: We are more on the “let’s use the same code everywhere”.

We do not want our users to have to rewrite their code if they want to embed 3D inside react native, ios or android.

And from a maintenance / reliability standpoint we want to have only one engine to test/validate.

Initially, when we first thought about BabylonNative we evaluated the idea of compiling TS into C++ but maintaining such a compiler was too much work

We had also to take in account tht our users are Web Developers (like us) and we do not want them to have to learn Cpp to use bjs :slight_smile:

That being said the work done by Sam Dauwe is simply fantastic and I’m appreciative of his dedication!

By the way if Sam ends up reading this I would love to add a link to his work in doc.babylonjs.com

1 Like

I understand, since the goal is not exactly performance then it makes sense to go with the BabylonNative approach.

Maybe there could be a solution if the goal was performance and still allow developers to use javascript/typescript, such as an engine with a cpp core and javascript/typescript as a scripting language.

yep this would have been an option but we also wanted to make sure we were not duplicating our effort by maintaining multiple engines.

I’ll try to ping Sam to see if he wants to be hosted in our doc at least :slight_smile:

Ok, thanks for the reply man.

1 Like

Hello,

at this moment we are developing BabylonCpp with 2 people. Keeping up with all the changes in the BabylonJS core library is indeed challenging and takes up the most time, because some parts are more difficult to map to C++ and we port all the JS code manually. So from a reliability and feature point of view we are not at the level of BabylonJS.

Using BabylonCpp as base for Babylon Native is not something I would recommend at this moment. You will have to invest a lot of time and effort to get it at the same level as the JS version and you will have to maintain 2 engines (meaning each feature has to be implemented, tested and maintained twice). I like the idea of Babylon Native. I already got the question a couple of times how to integrate BabylonCpp in a react native application. With Babylon Native this seems easier to achieve compared to BabylonCpp.

BabylonCpp is for me a hobby project, probably that is the reason why I did not made much publicity about it. A lot of publicity might mostly attract people expecting the same level of quality and support of the BabylonJS version or people who start comparing it with the high-end C++ engines like Unreal Engine and request similar features, that is something I want to avoid.

At this moment we are happy with the current state of the engine, we have a nice demo video. Last month we started working on a WebAssembly version, we have a first POC version ready and are currently working on resolving some of the rendering issues. The code is also in sync with a recent BabylonJS 4.1.0 beta version. I am planning to create an announcement post on this forum once we have a more stable WebAssembly version.

In case you have a specific use in mind or want to contribute let us now, any feedback or help is welcome :smile:

@Deltakosh yes, I want to be hosted in the BabylonJS doc :smile: , I should create a pull request for this in the Documentation repo? Do you have any template or conventions I should follow?

1 Like

So glad you guys working on it :slight_smile:
Here is the doc: Improve Documentation - Babylon.js Documentation

Thanks for the link :grin:
I will look into it in the next couple of days.

1 Like

Thanks!

Indeed, I am using: GitHub - ocornut/imgui: Dear ImGui: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. This is a C++ library like you mentioned.

The Dear ImGui library also has JavaScript bindings. The other library you mentioned also works but seems to be the ImGui C++ code compiled to WebAssembly without having the JavaScript bindings for the ImGui API. It depends what you need and if you want to develop mainly in C++ or JavaScript.

2 Likes