-
-
Notifications
You must be signed in to change notification settings - Fork 36k
WebXRManager: Set glBinding
separately from layer creation.
#31443
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
glBinding
separately from layer creationglBinding
separately from layer creation
Can you please keep
https://github.com/mrdoob/three.js/blob/dev/src/renderers/common/XRManager.js |
I didn't notice that class, but sure thing. But is it basically just falling back to a WebGL implementation right now? |
|
glBinding
separately from layer creationglBinding
separately from layer creation.
/cc @cabanier |
Thanks for the ping! This change looks good to me as the binding does not require layers and afaik this is not a heavy operation. We could potentially improve it with lazy initialization so it's only constructed when needed. |
This has an impact on the Meta Immersive Web Emulator, and anything else using the WebXR Device API polyfill without the WebXR Layers polyfill -- trying to construct the native impl of I don't think this is a problem to be solved here if |
Looking further into it I think that this is just a regression on #30319 due to moving the construction outside the |
I'm not sure I understand. We are still using the |
Sorry, I've gotten myself confused. I made an assumption that #30319 added the If you try any of the XR examples on the emulator you'll hopefully see what I mean. I'm not sure that it's something we can solve here anymore though. |
On (continued) further reflection, I think that implementing @cabanier's suggestion to lazily initialise the XRWebGLBinding is probably worth doing to go towards solving the above discussion. It would mean that |
If that fixes the issue with the emulator, I would say yes. |
Related issues: #26891, #30282
Description
I'm working on adding WebXR Camera Access, which requires
glBinding
to be set for access to the raw images. This is possible independently of WebXR Layers support, so I'm proposing to move the assignment outside of theuseLayers
guard.I note that XRWebGLBinding is defined in the WebXR Layers spec, but it works without layers as demonstrated on this example (source).