| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| } | ||
|
|
||
| vrManager.layersEnabled = xrInit.requiredFeatures.indexOf('layers') !== -1; | ||
| vrManager.layersEnabled = xrInit.requiredFeatures.indexOf('layers') !== -1 || xrInit.optionalFeatures.indexOf('layers') !== -1; |
There was a problem hiding this comment.
The fact that layers is part of the optionalFeatures does not mean that it will be available in the session. The check should use xrSession.enabledFeatures to determine this.
Though, sadly, some older WebXR implementations like on the Pico Neo3 (Link) and Pico 4 don't implement this, and enabledFeatures is undefined... (though they do support WebXR Layers)
Maybe something like:
vrManager.layersEnabled = xrSession.enabledFeatures ? xrSession.enabledFeatures.indexOf('layers') !== -1 : true;
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks. Indeed I see such usage in threejs repo https://github.com/search?q=repo%3Amrdoob%2Fthree.js%20enabledFeatures&type=code
I'll change with the line you suggested.
I hope AVP have xrSession.enabledFeatures properly defined then, otherwise the example won't fallback to the plane, please confirm @dmarcos
Sorry, something went wrong.
There was a problem hiding this comment.
On AVP, even if vrManager.layersEnabled is true, it won't actually do anything because we don't call addLayer from the layer component now that I did the proper check for XRWebGLBinding && XRMediaBinding.
Sorry, something went wrong.
… supporting WebXR layers Properly use xrSession.enabledFeatures to see if layers feature is enabled, but still fallback to true for older WebXR implementations on some Pico headsets where enabledFeatures is undefined but they do support WebXR Layers
|
I got confirmation from another user that XRWebGLBinding and XRMediaBinding are undefined on AVP. |
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description:
Make layers feature optional for type quad so it works on devices not supporting WebXR layers. Please confirm @dmarcos that the Layer Quad example is working with the fallback to a plane on AVP.
Changes proposed: