microsoft / HoloJS

Provides a framework for creating holographic apps using JavaScript and WebGL.
MIT License
1.19k stars 114 forks source link

HoloJS with HoloLens 2 #190

Open daniele-bordignon-kodis opened 3 years ago

daniele-bordignon-kodis commented 3 years ago

I am not able to compile an app for HoloLens 2 using HoloJS (my final purpose is to run HTML/WebGL files, threejs for example). I tried following the instructions from https://microsoft.github.io/HoloJS/ ( uwp-apps was my choice)

If I create a new DirectX11 project and I run it on the device I see that it works, everything is ok, app is built no the HoloLens. (platform ARM, I checked that this is the right one for HoloLens 2) But if I add HoloJS (via nuget) I get the missing files error (MSB3030 on libEGL.dll, libEGLv2.dll, libholojs-uwp.dll).

BUT if I run the same app (with holojs included) on the HoloLens 2 Emulator (x86 platform) it runs.

What am I doing wrong? Thanks

daniele-bordignon-kodis commented 3 years ago

If I manually add the missing DLLs app runs on device (ARM platform) But if I try to use the API I get errors: %1 is not a valid win32 app

daniele-bordignon-kodis commented 3 years ago

I found there is a vs2019 branch but I cannot understand how to use that. Tried following build instructions but cannot find all the files to build (is there an already built win32 holojs version to just link in nuget?)

Almost-Done commented 3 years ago

You are not doing anything wrong; it's just that HoloJS does not support HoloLens 2. There is no ARM64 HoloJS NUGET package and consequently the binaries are missing when you deploy the app.

Since HoloJS is using multiple open source projects to assemble its dependencies (ANGLE, LabSound, Canvas API, etc.), all of these projects would have to be built for ARM64 in order to support HoloLens 2.

daniele-bordignon-kodis commented 3 years ago

I see. So how am I supposed to build apps for HoloLens 2 with HTML and JS? Is there a way? Sorry, I know this is ot but I dinged a lot of documentation and stack overflow but most of them refers to HoloLens V1, even official Microsoft documentation I think.

Almost-Done commented 3 years ago

I don't know of a way to build HTML/JS apps for the HoloLens 2. These would be apps that you can install and/or submit to the store.

However, you could build immersive web apps that run in the web browser on HoloLens 2 using WebXR. See https://docs.microsoft.com/en-us/windows/mixed-reality/develop/javascript/webxr-overview

Web apps would be limited to the capabilities of WebXR - a subset of HL2's capabilities. I believe there is no web standard that would give you access to surface reconstruction, voice commands, etc.

daniele-bordignon-kodis commented 3 years ago

Thank you a lot. I already checked that I can run 3D capable webapps on a browser but my purpose was to encapsulate them. I already developed apps with Ionic so I'm used to work on web technologies (so they are my first choice) and then upload them on the stores.

Johnny-hg commented 3 years ago

@daniele-bordignon-kodis try Buildwagon , it is javascript development for Hololens 2 with full access to the device features like: spatial understanding, eye gaze, voice commands, azure spatial anchors... You can also package your app and upload it to the store, just like ionic.