playcanvas / engine

Powerful web graphics runtime built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.71k stars 1.36k forks source link

WebXR issue on PICO Neo 3 #6045

Closed Sycmasters closed 8 months ago

Sycmasters commented 9 months ago

I'm working on a WebXR experience, and everything was functioning well until the update to version 1.68.1 from 1.68. Since the update, all my WebXR projects have stopped working on the PICO Neo 3 headset. However, they continue to work on Meta Quest headsets. Even PC tutorials aren't working.

Here's a link to the tutorial I'm referencing. If this works, there shouldn't be any issues: https://developer.playcanvas.com/tutorials/webxr-vr-lab/

image

The problem occurs specifically on the PICO Browser.

Steps to Reproduce

  1. Open the PICO browser.
  2. Navigate to WebXR VR Lab Tutorial.
  3. Attempt to enter WebXR mode.
willeastcott commented 9 months ago

Hey @Maksims, do you know what's new in 1.68.1 that could have caused this?

Maksims commented 9 months ago

There were no changes between 1.68.0 and 1.68.1 that affected anything in the engine related to WebXR or feature detection. I unfortunately do not have PICO device to test.

To ensure it is only a version related, I've made 2 builds of the VR Starter Kit: 1.68.0 https://playcanv.as/b/548eb056 1.68.1 https://playcanv.as/b/86ea0a35

@Sycmasters please let me know if you do see a problem between these two versions also. If not, then the issue must be due to something else.

Sycmasters commented 9 months ago

Hi @Maksims

There's no difference in functionality between version 1.68.0 and 1.68.1; neither works for my project. I've tested it, and the last version that works correctly is 1.67.x.

image

So, the issue started with version 1.68.0, while everything operates as expected in version 1.67.x.

Maksims commented 9 months ago

Hi @Maksims

There's no difference in functionality between version 1.68.0 and 1.68.1; neither works for my project. I've tested it, and the last version that works correctly is 1.67.x.

So, the issue started with version 1.68.0, while everything operates as expected in version 1.67.x.

So the issue is with the 67 to 68 update. Do you have console logs?

Sycmasters commented 9 months ago

@Maksims Yes exactly, but sadly I don't have any logs, it doesn't give back any logs, I just try to enter VR mode and immediately takes me back to a normal web browser without any logs or errors, since I'm not sure what is happening I cannot provide more info than that I'm sorry.

Sycmasters commented 9 months ago

Following up on this issue, it seems like my non-PlayCanvas projects work on PICO, so it seems is an engine compatibility issue, but reviewing there is no log or anything that I can provide so I'm still lost about this.

fimbox commented 8 months ago

Same here on Pico4. The WebVR Demo does not start VR mode, here is the console output:

image

1.67.3 works 1.68.0+ does not start VR mode

fimbox commented 8 months ago

@Maksims Found the issue: TypeError: Cannot read properties of undefined (reading 'indexOf') at XrAnchors._onSessionStart (xr-anchors.js:166:64) at XrManager.fire (event-handler.js:257:26) at xr.js?id=110490397&branchId=8155e6fd-4975-42bb-aa86-1bf36db473c1:225:19

XrManager.session.enabledFeatures is undefined.

If it gets defined, everything works fine on the pico4 on 1.68.1

Maksims commented 8 months ago

This is very helpful! I will make a PR that allows XR features to detect availability in an alternative way.

In short: Pico WebXR implementation is somewhat outdated, that is why it has this property missing.

Maksims commented 8 months ago

@Sycmasters, @fimbox pushed a fix, if you could check it with custom built engine on your device, would be awesome.