immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
381 stars 84 forks source link

Update polyfill to accept standard-compliant code #71

Closed toji closed 5 years ago

toji commented 5 years ago

Fixes #50, #52, #53, #54

Alright, I've tried 20 different ways to re-package this into cleaner, easier-to-review chunks, but each time it ended up a mess and at this point it's preventing the code from being made more visible, so I'm just going to post this as one big PR for the moment. Apologies to anyone that was hoping to do a detailed review.

In terms of what this change does: It pulls in the work that @jacobcdewitt has done to make the polyfill compatible with the version of WebXR that will be in Chrome 76/77. This is not the same as the "VR Complete" version of the spec, but it's not too far off. It also includes a small shim to avoid the need for applications to specify a chrome-specific WebGL layer option that can be inferred from the session mode. This gets us to a point where any code written against the VR complete standard should actually be accepted by the polyfilled API, but some values are being ignored.

To get us to VR complete on top of this set of changes, we'll need the at least the following:

Oh, and we want to get the tests working again.

I'm sure there's some more minor changes in there that I've neglected to call out, but those are definitely the big ones.

jsantell commented 5 years ago

wow! lovely, i'll take a look :smile:

jsantell commented 5 years ago

Also for mergability, removing the build/* files from the commit and squashing will be nice :+1:

toji commented 5 years ago

Took a bit, but I should have all the feedback addressed now. Thanks Jordan! And yes, this will absolutely be a squashed commit when all is said and done. 😄