-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
WebXRManager: Added depth sensing support (v2). #27586
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
4c6a4df
to
fbe9ab6
Compare
Cool! What's your perception of it? |
See https://twitter.com/rcabanier/status/1748050448270135425 |
fbe9ab6
to
986ee41
Compare
For some reason I get a 90° around Y rotated camera here in our scenes, and frustum culling is wrong. Does this maybe not work when the camera is parented to something or the camera is moving after the session is started? Edit: I think the nested render call might be an issue, there's a lot of extra stuff going on – e.g. all onBeforeRender callbacks and so on will be executed again |
Yeah, maybe that all needs to move to the webxr manager. I'll take a look |
Thanks! |
that's possible. We're not sampling from the surrounding pixels in this version. |
986ee41
to
0cb5b2b
Compare
@hybridherbst I updated the PR. It's even simpler now |
0cb5b2b
to
7532228
Compare
7532228
to
fad7c39
Compare
Thank you, that works for me now too! Great to be able to compare the two approaches – and a hard decision on what's better suited for three.js 🗡️
Here's a quick test with custom shaders on v1: https://twitter.com/hybridherbst/status/1748106798173733036 Maybe one possible approach could be:
|
@hybridherbst maybe we can ship @mrdoob 's suggestion as an MVP but also leave the door open for experiences to do better. Maybe we can optionally turn off the automatic occlusion and let experiences define custom shaders to do it themselves. |
@mrdoob thoughts? |
Yeah! This feels so much better! |
Does this work on Quest 3 already or do I have to enable any flag? |
It works in latest Quest 3 Browser (OS should be updated too I guess), without a need to enable any flags. |
Correct. It's enabled by default. The first time you use it in browser, you should get an OS permission prompt. |
@mrdoob If you're ok with the changes, we can submit and then fine-tune it so people can still use a custom shader if they want |
I've seen these as well in regular WebXR sessions. I believe it's because three is using a swapchain texture that is out of band. |
I don't understand what that means... Are we doing something wrong? Do we have to change something? And if so, what do we need to change? Is it an issue in the Oculus Browser instead? And if so, are you planning to address it? |
This comment was marked as outdated.
This comment was marked as outdated.
Ignore my last comment, we were clearing the renderer which is what caused the issue. have use cases where we'd like to occlude the hands but selectively occlude planes. Is there a way to adjust the occlusion? |
If you want to occlude on a per object basis, you need to do the occlusion in the shader. Maybe we should give you access to the depth texture and not populate the rendertarget with the depth pixels |
that would be great, honestly being able to pass a distance parameter would work too. I'd love to integrate this and abandon our render order hack, but not at the cost of losing a lot of the MR features we've added. |
filed a feature request: #27664 |
@cabanier can you please answer my question? |
I'm unsure what the |
Thank you! |
This is a bug on the browser side. I will fix it. No changes in three are needed. |
I found and fixed the problem in the browser. It will be part of the next browser release. |
@mrdoob I fixed this problem using the WebXR samples. However, it is still happening in three.js. |
I dug a bit deeper. It seems that drawing the depth texture is generating an invalid operation when it executes drawElements to paint the depth into the framebuffer. Do you know why this could be? |
Meta Quest 3 on the PTC received Meta system software v65 on April 26th, following the update none of the Depth Sensing API samples are performing local occlusion. Not sure if this is a Meta browser issue, threejs issue, or if Meta is no longer providing the browser with access to the depth sensor data on the Meta Quest 3. Neither of the following are providing any local deptha api based occlusion following v65 update, and they previously did at v64. threejs webxr_xr_dragging (this has me very sad as I find occlusion to be the COOLEST webxr feature to come around!) |
I had noticed that as well but it seems to be fixed on latest three.js when I pulled it down last week. |
AFAICT, the release versions should not be affected by my changes. There was a temporary issue in |
I didn't look very closely what caused or fixed the issue. depth sensing is broken on the public samples but working on |
Related: #27154.
Simpler approach to depth sensing proposed by @mrdoob.
We copy the depth into the destination frame buffer instead and have it sorted by fl
This contribution is funded by Meta