Performance and Capability of Native?

I’ve read that React Native can get pretty darn fast. Is Babylon Native being designed to take advantage of this and run our apps at near native speeds as well? Also, does this new way of doing things offer the ability to do break rules and do things that web browsers normally would not allow such as putting iframes in 3D space?

adding @bghgary

In terms of raw JavaScript performance, React Native runs slower than a browser on some platforms. This is mostly because JIT is disabled in certain scenarios (e.g. iOS or if using Hermes).

Yes, but if JIT is disabled, it will run slower than a browser. There may be things we can do to mitigate this, but we haven’t looked into it yet.

Yes.

2 Likes

I see, I wonder if that JIT issue will be corrected in the future. However, for the breaking of rules… is that something that is being worked on? The ability to use iframes in 3D space?

The reason I like that is because the browser has a ton of functionality for UI and app creation, so almost always it’s just easier to do traditional web dev instead of writing your own components and UI frameworks to compete with the likes of Vue or React. lol

I’m not sure what you mean by this. There are no iframes in React Native. Do you mean using a WebView in a 3d slate maybe? If so, this has nothing to do with Babylon Native.

I’m not well learned on what’s possible and what’s not with this stuff yet, so maybe it’s better if I just pose it as a question: can I bring a web view into the 3D space and interact with it on desktop and in VR?

I don’t know. :frowning: WebViews have nothing to do with Babylon Native.

Sorry, I mean in general. :slight_smile: In WebXR on native or in the browser.

I’m still not sure what you mean. Do you want to browse a web page in WebXR? If so, I have no idea. :slight_smile:

Something like this: https://i.gyazo.com/a4854a60e6568d1b2269ce3d0f56c87c.mp4

If I’m seeing this correctly, this is a native app hosting a WebView as a slate in VR? That may be possible if the WebView output can be retrieved and mirrored to a texture and inputs forwarded to the WebView. Just guessing though.

WebXR does have a Layers feature WebXR Layers API Level 1, where you may integrate html elements into your scene. I have never used it, & it is not currently implemented in BJS.

Even if it were, Native does not have a dom, so there is not going to be an OpenXR equivalent.

Also from a performance standpoint, the weakest XR area currently is that multi-view is not supported at this time. Getting it working will get a far better improvement than “going native”. My view of the primary goal of native is so there is a light weight deployment option outside of a browser, like an apps store.

The Layers feature on the surface appears to be what I am looking for, if it will do what people say it will. Will this be supported by BJS in the future once it’s more mature?

There has been an issue added by the person most likely to do something about this to the framework repo.

I would follow this, since I do not believe this can be done easily yourself at the application level, since it must be indicated when the session is requested. From spec:

If an author wants to use GL layers, they have to go through these steps:

  1. For any layer type other than ‘XRProjectionLayer’ request support through ‘requiredFeatures’ or ‘optionalFeatures’ in ‘requestSession()’ .
1 Like

Thank you!