Skip to content

Conversation

@dmarcos
Copy link
Member

@dmarcos dmarcos commented Nov 21, 2018

Add WebXR support along WebVR and Cardboard. tracked-controls is now a trivial component that sets either tracked-controls-webvr or tracked-controls-webxr depending on the available API. Easier to maintain and easier to deprecate the webvr component when the time comes. A reference to the controller, axis and buttonStates is set on tracked-controls to avoid breaking some 3rd party components that access them directly.

Moved THREE dependency to temporary branch until mrdoob/three.js#15290 and mrdoob/three.js#15242 merge.

Tested on:

  • Supermedium + Oculus
  • Firefox 63 desktop (WebVR), Oculus Rift, Samsung Odyssey+
  • Chrome 70 and 72 desktop (WebXR enabled via chrome://flags), Oculus Rift, Samsung Odyssey+
  • Pixel 2, Chrome 70 and 72 (WebXR enabled via chrome://flags)
  • Lenovo Mirage, Chrome 70 and 72 (WebXR enabled via chrome://flags)

Pending:

  • tracked-controls and tracked-controls-webxr tests.

  • Controller events. Current WebXR spec only emits one event / action as if the controller has a single button. The XRInputSource API is going to be revisited in the January F2F meeting and tracked-controls-webxr will evolve with it. As an interim solution Chrome has a WebXR Gamepad Support that provides a reference to a Gamepad in the InputSource object.

  • Testing on Daydream devices

@jsantell
Copy link
Contributor

Rad! Can the webxr-polyfill help at all here?

@dmarcos
Copy link
Member Author

dmarcos commented Nov 22, 2018

@jsantell Thanks for chipping in here. Does the webxr-polyfill have any advantage? I thought that the webvr-polyfill might be enough. If there's no native WebVR or WebXR APIs we polyfill WebVR. We will have to support both APIs for at least a year.

wmurphyrd pushed a commit to 3DataWill/aframe that referenced this pull request Nov 22, 2018
…or component update (fixes aframevr#3875) (aframevr#3835)

* skip buildData if just updating component directly (fixes aframevr#3875)

* set attribute performance test
@jsantell
Copy link
Contributor

Currently, the webxr-polyfill is not smoothing out the differences between browsers and API changes yet, but the spec may get to a point soon (January?) where we'll have some confidence that fundamental things won't be changing frequently. At that point, the polyfill can handle those browser-specific quirks and compatibility checks, much like the webvr-polyfill does (and was especially valuable 1-2 years ago when WebVR 1.1 support was less consistent than it is now)

That being said, in the mean time, if A-Frame targets WebXR, there's a single codepath targeting WebXR that gets mapped in the following platforms:

  • WebXR supported (polyfill does nothing)
  • WebXR supported but inconsistent/outdated/etc.: polyfill could patch the differences, like webxr-version-shim, or maybe should be handled by three?
  • WebVR 1.1 supported -- webxr-polyfill maps to WebVR 1.1 and gamepad -> XRInputSource
  • No XR/VR support -- falls back to Cardboard, just like webvr-polyfill.

@dmarcos
Copy link
Member Author

dmarcos commented Nov 28, 2018

@jsantell thanks for the info. Super appreciated.

@jsantell
Copy link
Contributor

@dmarcos no problem! I haven't evaluated all the post-TPAC WebXR changes yet, and for the next few months until thing stabilize, not sure what to do with the polyfill in the near term, but maybe something to bring up at the next IWWG call, webxr-polyfill support plan/goals etc., because the current state of WebXR is only available in Chrome, and in 3 months, it sounds like supporting Chrome 71ish and Chrome ~77 (or whenever WebXR 1.0 is slated, or looking rather stable) will be a lot of work, and low value considering the current iteration of WebXR will be mostly out of circulation at that point

@dmarcos dmarcos force-pushed the webxr branch 3 times, most recently from 39359cd to c83f44e Compare November 30, 2018 01:08
@dmarcos dmarcos force-pushed the webxr branch 3 times, most recently from f9fc2db to 760498c Compare November 30, 2018 02:33
@dmarcos
Copy link
Member Author

dmarcos commented Nov 30, 2018

@jsantell I think A-Frame needs are well covered with the webvr-polyfill in the short term. As you said, probably better to wait a bit on the webxr-polyfill until the spec is locked in.

@dmarcos dmarcos force-pushed the webxr branch 2 times, most recently from c5fe691 to 4c9dd0a Compare December 1, 2018 01:12
@ngokevin
Copy link
Member

ngokevin commented Dec 1, 2018

good work

@ngokevin
Copy link
Member

ngokevin commented Dec 1, 2018

One thing I would test is that in VR mode that children of the camera still get tracked. I saw matrixAutoUpdate was disabled, so the camera children trying to apply parent matrix might not update correctly.

@remkoboschker
Copy link

I think I have the issue mentioned by @ngokevin that the children of the camera component are not tracking. I have a scene with a camera with look-controls rotation a sphere with bands surrounding it to make rotations more visible. There is a mirror in the scene and I cannot see myself move. But only in vr mode and only on the Oculus go. It works fine on Chrome 72.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants