-
-
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
Improve WebXR layers feature testing #30112
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
09eb918
to
d733ca0
Compare
d733ca0
to
da6ea94
Compare
I'm afraid I do not understand the topic well enough to make an informed decision so I defer to @toji . Related: It seems this PR causes issues with at least on type of headset: #30263 Edit: It is now confirmed that this PR breaks WebXR on PICO 4, see #30263 (comment). |
This is likely because the Pico browser lags Chromium by several releases so it doesn't support |
Apologies for any breakage which this may have caused! Rik is correct in that you shouldn't need the However, the previous code wasn't ideal either. Specifically, I'm working on WebXR/WebGPU integration which will rely on using the You can argue that this is a Chrome implementation issue and that perhaps WebXR/WebGPU support should be gated on a minimal WebGL Layers implementation, but unfortunately at this point I can't guarantee that I'll be given the time to implement that. In my opinion the check should at least shift from looking for the existence of (I think the check is probably OK for A question I have for @cabanier: Is there a performance or capabilities reason (on Meta devices or in general) why developers might prefer to use a single projection layer instead of an Finally, I'm not sure why Pico would be hitting a bug with |
I agree. That code can stay.
projection layers give you more control over multisampling. They also support texture arrays which are required for multiview.
Yes, this must be a bug in the pico browser. It would be nice if someone could debug where this is going wrong. |
I got hold of a pico headset and was able to reproduce the problem. |
Description
Currently Three.js tests for WebXR layers support by checking to see if the
layers
attribute is present in thesession.renderState
object. This isn't ideal, however.It's possible that the
layers
attribute may be present but not usable if the session did not request the'layers'
feature, if they did request it but the browser denied it, or if the browser supportslayers
but the backend being used does not.A more reliable way to check for
layers
support is to look at thesession.enabledFeatures
list and check to see if it contains the'layers'
string. If so the the session is confirmed to have layers support and the rest of the code can be used as-is. This PR makes that change to both the layers sample and the WebXRManager.