Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Depth Sensing for immersive-ar applications. #23881

Closed
listdo opened this issue Apr 11, 2022 · 12 comments
Closed

Enable Depth Sensing for immersive-ar applications. #23881

listdo opened this issue Apr 11, 2022 · 12 comments

Comments

@listdo
Copy link

listdo commented Apr 11, 2022

Is your feature request related to a problem? Please describe.

In my research project we are looking for a way to use depth sensing and access depth data from immersive ar applications. Currently it seems like it is not possible to enable the optional feature "depth-sensing" provided by the api of modern browsers.

Describe the solution you'd like

I would like to be able to use the new "depth-sensing"-feature provided by the modern chrome browser api described in: https://www.w3.org/TR/webxr-depth-sensing-1/

Describe alternatives you've considered

All alternatives that lead to the same result.

Repository owner deleted a comment Apr 11, 2022
@mrdoob
Copy link
Owner

mrdoob commented Apr 12, 2022

@listdo Which modern browsers support this feature? Is there a demo we can try?

@listdo
Copy link
Author

listdo commented Apr 12, 2022

@mrdoob
As far as i understood it is currently only supported by Chrome and Chrome for Android. In the following link is the feature status for chrome and there are two examples linked that use the browser api.

https://chromestatus.com/feature/5742647199137792

@julapy
Copy link

julapy commented Jan 3, 2023

here is the WebXR sample:
https://storage.googleapis.com/chromium-webxr-test/r1067245/proposals/phone-ar-depth-gpu.html
this feature is available since Chrome 90 and can be enabled session.depthDataFormat != "luminance-alpha"

with a bit of work, this would allow occlusion of threejs scenes with the real world, like this:
https://developers.google.com/ar/develop/unity/depth/quickstart

@zz85
Copy link
Contributor

zz85 commented Feb 13, 2024

it looks like this is supported today by passing { 'optionalFeatures': [ 'depth-sensing'] } to XRButton.createButton()

https://github.com/search?q=repo%3Amrdoob%2Fthree.js%20depth-sensing&type=code

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 27, 2024

A first approach of depth sensing has been implemented via #27586 (r161).

@Mugen87 Mugen87 closed this as completed Feb 27, 2024
@billleap
Copy link

Hi, I just tried the Dragging demo: https://threejs.org/examples/webxr_xr_dragging.html

and got the following warning:

XRButton.js:69 Feature 'depth-sensing' is not supported for mode: immersive-ar

@mrdoob
Copy link
Owner

mrdoob commented May 14, 2024

@billleap Any chance you can share the device you got that error with?

@idrisshah
Copy link

@billleap Any chance you can share the device you got that error with?

I am seeing the same error on Magic Leap 2 device. I think the issue is because depth-sensing implementation in threejs does not use XRDepthStateInit, while using depth-sensing feature.

@billleap
Copy link

@mrdoob @idrisshah
I was using S21 5G (SM-G991U) Android 13.
I used ADB and 'chrome://inspect/#devices' to see the warning.

@mrdoob
Copy link
Owner

mrdoob commented May 16, 2024

I am seeing the same error on Magic Leap 2 device. I think the issue is because depth-sensing implementation in threejs does not use XRDepthStateInit, while using depth-sensing feature.

@cabanier Are we missing a check before using depth-sensing?

@cabanier
Copy link
Contributor

I am seeing the same error on Magic Leap 2 device. I think the issue is because depth-sensing implementation in threejs does not use XRDepthStateInit, while using depth-sensing feature.

@cabanier Are we missing a check before using depth-sensing?

It looks like the Quest browser is not requiring that this dictionary is passed. Strange, because I would expect the existing Chromium code to enforce this.
We should fix up three.js and pass an empty dict. I'll file an issue to make this optional.

@idrisshah
Copy link

Strange, because I would expect the existing Chromium code to enforce this.

Chromium does seem to enforce it here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants