Releases: immersive-web/webvr-polyfill
v0.10.4
v0.10.3
We got reports (#307) of polyfill breakage (thanks @dustinkerstein!) on newer versions of Chrome. In Chrome m65, a regression to devicemotion
events doesn't provide rotationRate
, breaking the head tracking in the polyfill, and m66 switching DeviceMotionEvent.rotationRate
values to use degrees instead of radians to be aligned with the spec. Separately there's another issue where deviceorientation
/devicemotion
events are fired at 5-10hz in Chrome m65/m66. This doesn't consistently occur.
This release includes an updated CardboardVRDisplay with fixes for the devicemotion
Chrome m65 regression by using a deviceorientation
fallback (immersive-web/cardboard-vr-display@d770e01)
and does not take advantage of sensor fusion, and also includes a fix to handle Chrome m66's rotationRate
unit change (immersive-web/cardboard-vr-display@75a6d51). The issue of lowered device motion rate in Chrome m65/m66 can be tracked at crbug.com/819413. With Sensor API (#10) now being supported instead of devicemotion
, one temporary workaround is enabling sensors. Read here to learn more about enabling Sensor API.
TLDR: If seeing issues in Chrome m65 and later versions, please update to the latest version of the WebVR Polyfill. There may be some stuttering in the pose due to platform issue on m65/m66, which can be solved locally by enabling chrome://flags/#enable-generic-sensor
, and there could be a browser update to fix the low frequency rate of device events. Changes have been sent downstream to A-Frame (aframevr/aframe#3453). If upgrading from 0.9.x
to 0.10.x
, be sure to call the WebVRPolyfill
constructor with your configuration object rather than using window.WebVRConfig
(example).
Other Noteworthy Fixes
- Use Sensor API if available instead of
devicemotion
(#10) - Fires
vrdisplayconnect
on the polyfilled VRDisplay only if there are no native displays (#303) - Cache
requestAnimationFrame
incase consumer overwrites, fixes WebVR Unity Exporter issue (#308) - Limit console spam (immersive-web/cardboard-vr-display@5facde2)
- Add device information in the DPDB for iPhone X (immersive-web/webvr-polyfill-dpdb#35)
v0.10.0
v0.10.0
This is one of the largest updates for the Polyfill in quite some time! Most changes are refactoring, focusing on pulling pieces out to make it easier to scope, test, and work on future changes as the WebXR Device API approaches, so we can be more confident in changes without breaking edge cases. The polyfill was also scope creeping a bit, doing more than just providing a stable API surface for developers to target, and many of these features have been removed that are better off in userland and on a per-project basis.
Feature Changes
- The polyfill is now enabled by calling the exposed constructor,
new window.WebVRPolyfill(options)
. Previously this was handled by defining options on a globalwindow.WebVRConfig
object, and the polyfill would instantiate itself immediately, or require the user to callwindow.InitializeWebVRPolyfill()
ifDEFER_INITIALIZATION
was set.DEFER_INITIALIZATION
has been removed, the polyfill no longer instantiates itself, and options are passed into the constructor rather than relying on a global object. This makes it easier to work with in module environments and other JS build systems. - The webvr-polyfill no longer supports adapting 1.0 WebVR APIs to work with 1.1 content. In the event of a 1.0 browser using the polyfill, everything will be polyfilled as if 1.0 support does not exist.
InstallWebVRSpecShim()
has been removed. navigator.vrEnabled
property has been removed. This was used to indicate if displays exist, which can be done by checking the return value ofgetVRDisplays()
.MouseKeyboardVRDisplay
has been removed. This provided a monoview VRDisplay with some primitive controls for a 3DOF experience. This is better handled with custom controls or OrbitControls depending on the experience.MOUSE_KEYBOARD_CONTROLS_DISABLED
option has been removed. This means on desktop, the only displays that can exist are native, so user code should handle when no displays are found.- Rules for injecting polyfilled displays have changed and simplified. With the removal of
MouseKeyboardVRDisplay
, and the WebXR Device API only allowing one display rather than an array of displays,ALWAYS_APPEND_POLYFILL_DISPLAY
has been removed. A new option,PROVIDE_MOBILE_VRDISPLAY
has been created to provide aCardboardVRDisplay
when on mobile and the native API exists but no native displays exists.true
by default, this means that the polyfill is always injected on mobile when enabled, since we won't know immediately if any native displays exist.FORCE_ENABLE_VR
has been removed. This always provided aCardboardVRDisplay
, even on desktop, used mostly for debugging purposes. TOUCH_PANNER_DISABLED
has been removed. This is not a part of the WebVR 1.1 spec.- Added a
DEBUG
option. Previously this was triggered by a?debug
query parameter, which caused issues with other environments. - The
main
package.json entry now points to the built output rather thansrc/node-entry
. This lets us take advantage of our build system and not require consumers to handle any transformations implemented. - Many
WebVRPolyfill
methods and properties have been removed:isFullScreenAvailable
,isCardboardCompatible
,isMobile
,NativeVRFrameData
,getVRDevices
,enableDeprecatedPolyfill
,isDeprecatedWebVRAvailable
,isWebVRAvailable
.
Infrastructure Changes
- The CardboardVRDisplay has been pulled out of webvr-polyfill into it's own repo googlevr/cardboard-vr-display. This is by far the most complex part of the polyfill, and pulling it into its own repo makes it easier to draw an abstraction line between the polyfill and CardboardVRDisplay, consolidate cardboard-specific rendering issues, allow others to consume and use the CardboardVRDisplay alone, and make it easier to contribute.
- We now have some tests! The tests cover the logic behind when and how things are polyfilled. There aren't many tests yet as it took a bit to get to this point, but looking forward to even more test coverage in the future.
- Migrated from Webpack to Rollup for building. We've experimented with Rollup for our team's other projects and prefer it for libraries that are consumed by other projects due to its tree-shaking (227kb to 179kb for webvr-polyfill.js) and it's more simple configurations.
0.2.4
0.2.1
0.1.0
Main feature added in this release is head tracking orientation prediction. Many browsers provide DeviceOrientationEvents with motion-to-photon latency of >150ms. This latency is very sickness inducing. By predicting head tracking into the future based on DeviceMotionEvent, we provide much more responsive head tracking.