WebXR WebXRDomOverlay and WebXRImageTracking on HoloLens

Hi!

I’ve been testing out BabylonJS WebXR on the HoloLens 2 and it’s a blast, and the workflow is so much easier than natively developing for the HoloLens.
I’ve been trying to find out all it can and can’t do. I seem to have hit a wall with WebXRImageTracking, and I think it’s only available for chrome on android. However, I can’t seem to find if I could use the camera on the HoloLens through WebXR and whip up something myself?
And next, to my surprise WebXRDomOverlay.isCompatible() gives true. But when I try to add something to that overlay or try https://playground.babylonjs.com/#KYJB34#2 I see nothing on the HoloLens, do I need to enable anything else?

Thanks!

Adding @syntheticmagus

Hi Peter,

I’m not a huge expert on HoloLens 2 (@chrisfromwork will definitely have better information than I will), but regarding the first question, while I don’t think you can access the color camera on HoloLens through WebXR, you should in theory be able to access it like a normal Web cam. An easy way to test this would be to try creating a Web cam video texture and putting that on an object in your scene; if it shows the video, then you could theoretically use that video to create any kind of additions you want. I don’t have any information on the DOM overlay thing, unfortunately. It doesn’t sound like something that would work well with immersive XR, though; can DOM elements have 3D position?

Hi syntheticmagus! (great name by the way)
I should’ve thought of the normal webcam solution, I’ll check it out!
As for the DOM overlay, I was hoping to get like floating planes with the elements on them. But I had a feeling that was a bit too good to be true.

1 Like

Hi Peter,

Okay, I think I understand the use case. Have you checked the holographic slate capability of the 3D GUI? It’s not exactly the DOM, at least not directly; but it is a sort of floating plane with elements on it, so maybe it would work for your use case. Hope this helps, and best of luck!

2 Likes

Oh shit, that’s major, thanks for linking that! I hope that does what I think it does.

1 Like

@Peter Hi Peter I am currently also working with WebXR and the HoloLens! Have you been using Microsoft Edge? I am currently having trouble running my Babylon code on the HoloLens. Have u enabled the flags and used Node as a local server or by creating a React Native app?

Hey! I’m using just React, not React Native for this part. I am using node. For edge to work you need the new edge that’s based on chrome. I didn’t have to enable flags on this.
You get that with

You also need HoloLens 2 for this, I don’t think it’ll work on HoloLens 1 unfortunately. A big thing is also that you need to have https. Which you usually don’t get when running locally. So I used ngrok https://ngrok.com/

2 Likes

Awesome thanks!

1 Like