WebXR Plane Detection demo not working?

Babylon.js Playground.

Working after enabling webxr incubation

Doesn’t seem to work in the iOS XRViewer, however…

https://immersive-web.github.io/webxr-samples/report/

Hmm, everything except for core is reported as unsupported, even though I have tested e.g. hit tests and they work. Also, pressing Begin Session on immersive-ar doesn’t do anything.

iOS doesn’t support WebXR officially, so everything there is very experimental.

The plane detection demo doesn’t need hit test only. it needs the plane detection feature, and i believe it also uses anchors to add meshes on top of those planes.

The anchors feature is neither enabled nor used in that demo ( Babylon.js Playground ). Incidentally, trying to enable it on iOS crashes the whole AR session.

Planes are detected on iOS, as evidenced by the debug draw, however something is wrong in the API either on side of the WebXR implementation or Babylon and this information is not communicated. Will attach screenshot later.

Yup, you are right - no anchors in this one. Thought you are referring to a different demo.

As it is working in chrome, and chomre is very good in keeping up with the specs, I would guess that it is not an API issue. I don’t know the viewer, and I sadly can’t test.

Is there any exception thrown, is there any way to debug this?

As plane detection is not an (optional) feature of XR, i would assume planes will be shown on every ar scene. Is it so?

Yeah, I think the plane detection runs in the background automatically on every scene. There is no exception thrown from my code that initializes the Babylon plane detection feature, but I don’t know if there isn’t any error thrown from anywhere else. I’ll see if I can find some way to debug this further.

Seems like they didn’t expose the API. They just show you how XR is seeing the environment.

Alright, will try ask folks over at the viewer app. Thanks for the help!

1 Like

Well, they have their own demo of rendering the detected planes and it’s working just fine: webxr-ios-js/index.html at master · MozillaReality/webxr-ios-js · GitHub

So I think maybe there are some slight inconsistencies in the API between Chrome and Firefox, with the Babylon implementation only accounting for Chrome?

This demo does not use plane detection. it uses anchors and hit tests like this demo - https://playground.babylonjs.com/#GG06BQ#3

The description reads: Render the anchors, including planes and face geometry, detected by the platform.

It uses something referred to in code as “world sensing”, which seems to refer to, among others, plane detection.
Initialized here: webxr-ios-js/index.html at master · MozillaReality/webxr-ios-js · GitHub
Calllback here: line 210
Plane mesh creation here: line 310

Screenshot:

The plane detection explainer (which is the standard we are following) can be found here:

What mozilla are doing is not part of the standard, and we cannot support it. You can, of course, implement this yourself, but it will only work in firefox reality (and will probably not work in any other AR-based device)

1 Like

You must have a new android phone. Setting the flag to enable is not a good solution when default setting works in ThreeJS and older phones. Its a babylonJS bug

Can you elaborate? Is plane detection not working?