How do I compile Babylon.js project into Iphone app?

Hello dudes,

how can I compile a program in Babylon.js into Iphone format? I want to run the program not in a browser but as an iphone application. Is tehre a way how to do it? Is there any instructions, or better tutorial for this? I searched the internet for information but did not find real tutorial. thanks for explaining in advance.

So for most web frameworks it would be pretty hard but fortunately, despite being still early maybe what you are looking into is babylon native :slight_smile:

Let me add @bghgary and @Cedric who can provide more info on this front.

1 Like

Website: https://www.babylonjs.com/native
GitHub: GitHub - BabylonJS/BabylonNative: Build cross-platform native applications with the power of the Babylon.js JavaScript framework

That should give you an idea hopefully.

2 Likes

Thanks for your answer. Link number one is going to the Babylon.js native promotional page. Something about multiplatformity… For more information, see the babylon.js forum and friendly community(important note :D). See link 2 for more information. A) you can download babylon.js native. But there is no executable file anywhere. Is CMake likely to build it? I tried to use cmake-gui.exe, but I got a compilation error. From the materials I still do not understand the philosophy of workflow, operation, assembly…Why should I use some other external programs like CMake?

Babylon Native does not have a prebuilt executable as it’s a library intended to be integrated into an executable. It’s up to you how to do that. You need to build it yourself using the instructions from the readme.

Perhaps this is not what you are looking for? Maybe you are looking for progressive web apps?

1 Like

Thanks for next info. I will read more about it then I can make more concrete question.

1 Like

You could also look at some tools like Cordova or Ionic but a PWA is a much easier option.

Holy Crap Nuts :slight_smile:

i just really taking a look at this and the native project… And Holy Crap Nuts :slight_smile:

Yo @bghgary … You know i gonna have a few questions about how to actually implement a project in BabylonNative.

First of all, from what i can tell the KEY native code that really does everything is the Babylon::ScriptLoader class. This looks like some kind of encapsulated V8 Javascript Engine for Babylon.js runtime (basically any javascript is looks like ???). You can eval script right into the runtime loader or actually LoadScript using the app:// protocol.

Thats really it… all it does from a native host application point of view (besides some native input manager pointer stuff).

The fact that is render scene content or loading gltf scene files is because one of the loaded javascript files is using babylon javascript to create a scene and optionally append gltf scene content… And script code starts the engine render loop… basically the same kind of shit you would do in Babylon Playground… Again… Holy Crap Nuts :slight_smile:

QUESTIONS:

1… Should i be able to run my SceneManager extension that registers its GLTF Loader so my Unity GLTF Parsing that i use in a regular babylon.js environment (provided I remove all the HTML DOM stuff)

2… Does console.log and console.warn work in BabylonNative ???

3… Does GLTF PBR Materials and shaders work… Basically can i still use PBRCustomMaterial the way i do in a regular babylon.js environment ???

4… Does babylon.gui.js work ???

Am i on the right track ???

2 Likes

Yes, once everything is in place. There will be bugs. :slight_smile:

Yes. Though all it does right now is log to the debug output in the examples. This can be replaced to anything you want.

Yes, once all the shader processing issues are resolved. We haven’t tested PBRCustomMaterials yet, but it should work.

3D GUI should work barring font rendering which we are eventually going to do, but it’s not there right now. 2D GUI uses HTML, so that’s not in scope.

2 Likes

How do you specify what javascript you want available ??

Cant tell how it knows what script files to package up that will be available via the app:// protocol ???

The ScriptLoader is intended help with this. Call ScriptLoader::LoadScript to load scripts in order. The contract for this class is not fully baked yet as it behaves a bit strange in some situation, but it should work for simple cases.

This is up to the app. Babylon Native is currently a static library. The app consuming Babylon Native is responsible for how the package is built. The app:/// protocol will get the file inside the app package. It is different depending on which platform. Android uses AAssetManager. iOS/macOS uses [NSBundle mainBundle]. Window UWP uses ApplicationModel::Package::Current().InstalledLocation().GetFileAsync. WIN32 currently doesn’t support app:/// protocol, but maybe it can load from the executable path. This part certainly can use some documentation. :slight_smile: