Skip to content
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

Define browser support #63

Open
jsantell opened this issue Jun 18, 2019 · 0 comments
Open

Define browser support #63

jsantell opened this issue Jun 18, 2019 · 0 comments

Comments

@jsantell
Copy link
Contributor

The polyfill currently is (was) targeting the latest WebXR API spec. The webxr-examples repo contained a shim that would patch various iterations of the implementation in Chrome (patching changes between Chrome 68, 69, 70, etc.). With the WebXR API stabilizing, it's now appropriate for the polyfill to handle these smaller 'patches' between versions. We should be explicit on what browsers/devices we attempt to support. We should:

  • Define support range: e.g. last 2 major versions, plus Chrome M73 (Magic Leap, Samsung)
  • Document support range in README plus any extra config/modules needed to support different browsers. <model-viewer> has great matrix+docs for its support, which require devs to include different polyfills, which aids in configuring the tradeoffs of your choosing
jsantell added a commit that referenced this issue Jul 1, 2019
…onfig, and move global to a configuration option rather than the first argument to WebXRPolyfill constructor, a breaking API change. Also disable babel compilation now until we can decide on an action in #63.
toji added a commit that referenced this issue Aug 12, 2019
This change squashes multiple changes from @jacobcdewitt (and a couple
from myself) into one for easier history review. The comments for each
change have been preserved below. The cumulative changes enable the
polyfill to accept code that was written against the "VR complete"
version of the WebXR spec, even if support is not fully spec compliant
at this time.

Squashed commit comments
------------------------

Update XR interface and remove XRDevice

Fixes #55. Also changes the syntax of the WebGL context compatibility
methods because they required an XRDevice to function properly.

Add two new configuration params: allowCardboardOnDesktop, cardboardConfig, and move global to a configuration option rather than the first argument to WebXRPolyfill constructor, a breaking API change. Also disable babel compilation now until we can decide on an action in #63.

change WebXRPolyfill signature to match config change, and correctly export XRSessionModes

display magic window in inline session for desktop

rename XRDevicePose to XRViewerPose

update packages

npm install serve

no longer checkin build output files

Don't checkin webxr samples or media folders.

requestFrameOfReference => requestReferenceSpace

update reference space types

Implement XRSession.updateRenderState

Add views array to XRViewerPose.

This also requires implementing part of XRRigidTransform and
adding a transform to XRView.

As of this commit, I have the xr-presentation.html sample from
https://storage.googleapis.com/chromium-webxr-test/r672724/xr-presentation.html
working with this polyfill when hosting the samples locally. The only
change I had to make to the html file was how the polyfill gets injected.

I tested in the following browsers on Windows using an Oculus headeset:
- Chrome 75 with WebVR flag enabled, but WebXR flag disabled
- Firefox 67.0.4

Update reference space types.

- remove head-model
- eye-level => local
- stage => bounded-floor

XRCoordinateSystem => XRSpace, XRFrameOfReference => XRReferenceSpace

start working on XRReferenceSpace.getOffsetReferenceSpace, which requires updating XRRigidTransform to compose the matrix based on position and orientation values

comment out work in progress changes

session.inputSources attribute

more work for XRFrame.getPose

more work for getPose. Use gl-matrix to compose/decompose matrix

XRRay from external polyfill

more updates to getPose so that input-tracking.html finally works (but it does place the user too low and controllers sometimes go through the floor and a dot is shown for the gaze).

handle floor-level reference spaces in a more general way

remove log statement

more work for getOffsetReferenceSpace

fix issue in getOffsetReferenceSpace

negate quaternions in XRRigidTransform constructor to fix rotation issue

try some more things for getPose to make teleportation work, but there are still issues

always return a Cardboard device when no VR displays are connected so that inline sessions are always supported

remove console.log statements

Expose input poses and gamepad from WebVR

Made sure that the data exposed to gamepads via the WebVR API is
properly forwarded to the WebXR API surface. Includes both the poses
and repeating the original gamepad object on the XRInputSource.gamepad
attribute. No remapping of the gamepad API data is being done at this
point. Removed the XRInputPose, because it's no longer part of the API.

Allow mapping of WebVR gamepad values

Provide a mapping table that allows WebVR-style gamepads to be remapped
so that they can conform to the WebXR conventions and the `xr-standard`
mapping. Also allows for static transforms to be applied to either the
grip or the targetRay poses so that the single value that WebVR supplied
can be used for both spaces accurately.

Add Oculus Go mappings and fix some bugs

Fix some offset reference spaces and inlineVerticalFieldOfView

Add gamepad mapping for WMR controller.

Fix several mappings for Chrome 76

Cleanup

Add/update method annotations.
Remove commented-out code.
Split up long lines.

remove XRLayer

XRLayer is no longer in the spec.
XRWebGLLayer no longer inherits from XRLayer.
getViewport is now on XRWebGLLayer

Remove XRPresentationContext. It's no longer in the WebXR spec.

Teleportation seems to work now. Had to remove the quaternion inversion in XRRigidTransform

cleanup

Make XRViewerPose inherit from XRPose. Now the positional-audio sample works.

remove stale comment

Remove XRRay

Fix error when loading with polyfill when native WebXR is enabled on mobile devices. Don't try to patch in a cardboard display in this situation because it's a rare corner case.

Throw exception when trying to create bounded reference space since the polyfill does not support them.

Cleanup XRReferenceSpace + XRViewerPose code.

Remove unused function.

Only expose views array via XRViewerPose.

Update getViewport comments.

Added a small shim to allow spec-compliant code to run on Chrome 76

Co-Authored-By: jacobcdewitt <jacobcdewitt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant