Did anyone try using Electron to package a Babylon.js with Web XR (VR) project?
It working good, but the packaged application does not recognize the VR and I get no “VR Icon” to enter the VR mode.
Thanks!
Did anyone try using Electron to package a Babylon.js with Web XR (VR) project?
It working good, but the packaged application does not recognize the VR and I get no “VR Icon” to enter the VR mode.
Thanks!
I’m pinging @RaananW for XR related questions.
Hello Mem!
My honest answer is - I never tried, sorry. However, I was asked a few times already about it, and I do know it is possible. Back when I was first asked I found this article - Electron + WebXR - April 2021 (bai.dev), which I hope will help you enable webXR on electron.
AND, I will gently ping @yuripourre , which I know have a LOT more experience than me on that subject, and he might share some insights, if he can
Hey @litinsa,
I’ve tried and learned a lot during the process. As @RaananW mentioned, it’s possible. I’ve spent some time making some of my games working with electron. If you don’t need WebXR or VR it’s really easy to do.
If you really want to use Electron
When it comes to include WebXR, the post from 2021 is still valid, you must recompile Electron linking the OpenXR runtime library. It’s not the easiest thing to do if you are not familiar with compiling C/C++ code and particularly tricky on Linux if you try to link monado (as your OpenXR runtime).
The problem of having this custom Electron version is because you lose the ability to use electron-forge and in case you want to generate artifact to other architectures you must do manually.
If you don’t care about electron and just want to make your WebXR app run on a PC I highly recommend using Tauri (https://tauri.app/)!
The way I made it work with WebXR is: I build my Babylon.js project and generate the index.html and build.js. Then I embed them in a Tauri project. It just works!
The process to generate Tauri artifacts is similar to Electron and the size of the binary is way smaller.
I recommend going with Tauri and please let me know if I can help!
Thank you all for your kindness help.
I will try tauri.app (haven’t used it before)