WebXR: Difference between revisions
Appearance
Xinreality (talk | contribs) |
Xinreality (talk | contribs) No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Platform Infobox | {{Platform Infobox | ||
|image=[[File:webxr logo1.png|350px]] | |image=[[File:webxr logo1.png|350px]] | ||
|Type=Virtual Reality | |Type=[[Virtual Reality]], [[Augmented Reality]] | ||
|Subtype=Web API | |Subtype=[[Web API]] | ||
|Creator=[[Immersive Web Working Group]] and [[Immersive Web Community Group]] | |Creator=[[Immersive Web Working Group]] and [[Immersive Web Community Group]] | ||
|Developer=[[W3C]] | |Developer=[[W3C]] | ||
Line 10: | Line 10: | ||
|Devices=[[VR headsets]], [[AR headsets]], [[AR-enabled smartphones]] | |Devices=[[VR headsets]], [[AR headsets]], [[AR-enabled smartphones]] | ||
|Accessories=[[Motion controllers]], [[Gamepads]], [[Hand tracking devices]] | |Accessories=[[Motion controllers]], [[Gamepads]], [[Hand tracking devices]] | ||
|Release Date= | |Release Date=5 February 2019 (First Public Working Draft) | ||
|Price=Free Web Standard | |Price=Free Web Standard | ||
|Website=https://www.w3.org/TR/webxr/, https://immersiveweb.dev/, https://github.com/immersive-web/webxr/blob/master/explainer.md, https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API | |Website=https://www.w3.org/TR/webxr/, https://immersiveweb.dev/, https://github.com/immersive-web/webxr/blob/master/explainer.md, https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API | ||
}} | }} | ||
'''WebXR Device API''' (commonly known as '''WebXR''') is a [[Web API]] developed by the [[World Wide Web Consortium]] (W3C) that provides interfaces for accessing [[virtual reality]] (VR) and [[augmented reality]] (AR) devices on the web. WebXR enables developers to create immersive experiences that work across a wide range of [[hardware]] [[platforms]], including [[head-mounted display]]s, [[mobile AR devices]], and [[desktop environments]] with appropriate [[peripherals]]. | '''WebXR Device API''' (commonly known as '''WebXR''') is a [[Web API]] developed by the [[World Wide Web Consortium]] (W3C) that provides interfaces for accessing [[virtual reality]] (VR) and [[augmented reality]] (AR) devices on the web. WebXR enables developers to create immersive experiences that work across a wide range of [[hardware]] [[platforms]], including [[head-mounted display]]s, [[mobile AR devices]], and [[desktop environments]] with appropriate [[peripherals]].<ref name="w3c-webxr"></ref> | ||
The API allows web applications to detect compatible [[VR/AR devices]], query their capabilities, render 3D scenes to the devices at the appropriate [[frame rate]], and respond to [[input]] from associated controllers. WebXR represents an evolution from the earlier [[WebVR API]], expanding the scope to include augmented reality and other immersive technologies under the "[[XR]]" (Extended Reality) umbrella. | The API allows web applications to detect compatible [[VR/AR devices]], query their capabilities, render 3D scenes to the devices at the appropriate [[frame rate]], and respond to [[input]] from associated controllers. WebXR represents an evolution from the earlier [[WebVR API]], expanding the scope to include augmented reality and other immersive technologies under the "[[XR]]" (Extended Reality) umbrella.<ref name="mdn-webxr"></ref> | ||
==History== | ==History== | ||
===WebVR: The Predecessor=== | ===WebVR: The Predecessor=== | ||
The development of WebXR began with its predecessor, [[WebVR]]. The WebVR API was first conceived in spring 2014 by Vladimir Vukićević from Mozilla. Key contributors to the early API included Brandon Jones from Google, Boris Smus, and other members of the Mozilla team. | The development of WebXR began with its predecessor, [[WebVR]]. The WebVR API was first conceived in spring 2014 by Vladimir Vukićević from Mozilla. Key contributors to the early API included Brandon Jones from Google, Boris Smus, and other members of the Mozilla team.<ref name="webxr-wiki"></ref> | ||
On March 1, 2016, the Mozilla VR team and the Google Chrome team announced the WebVR 1.0 release. This early version of the API was implemented in Firefox and Chromium-based browsers, providing basic virtual reality functionality to web applications. | On March 1, 2016, the Mozilla VR team and the Google Chrome team announced the WebVR 1.0 release. This early version of the API was implemented in Firefox and Chromium-based browsers, providing basic virtual reality functionality to web applications. | ||
===Transition to WebXR=== | ===Transition to WebXR=== | ||
As the technology evolved, developers recognized the need for a more scalable and ergonomic API that would break backward compatibility with WebVR. Initially referred to as "WebVR 2.0," the new API was officially renamed WebXR to acknowledge its expanded scope that would include both VR and AR content. | As the technology evolved, developers recognized the need for a more scalable and ergonomic API that would break backward compatibility with WebVR. Initially referred to as "WebVR 2.0," the new API was officially renamed WebXR to acknowledge its expanded scope that would include both VR and AR content.<ref name="webxr-explained"></ref> | ||
The transition benefited from: | The transition benefited from: | ||
Line 33: | Line 33: | ||
* Multiple mature native APIs to draw inspiration from | * Multiple mature native APIs to draw inspiration from | ||
On September 24, 2018, the Immersive Web Working Group became official, formalizing the development process for WebXR standards. WebXR was designed to completely replace WebVR, with all browsers that initially shipped WebVR committing to adopt WebXR once the API design was finalized. | On September 24, 2018, the Immersive Web Working Group became official, formalizing the development process for WebXR standards.<ref name="immersiveweb-community"></ref> WebXR was designed to completely replace WebVR, with all browsers that initially shipped WebVR committing to adopt WebXR once the API design was finalized. | ||
===Recent Developments=== | ===Recent Developments=== | ||
The WebXR standard continues to evolve, with the WebXR Device API advancing through the W3C standardization process as a Candidate Recommendation. The editors of the specification come from major technology companies including [[Google]] and [[Meta]], with additional input from [[Mozilla]], [[Microsoft]], [[Samsung]] Electronics, [[Apple]], as well as various startups and invited experts. | The WebXR standard continues to evolve, with the WebXR Device API advancing through the W3C standardization process as a Candidate Recommendation. The editors of the specification come from major technology companies including [[Google]] and [[Meta]], with additional input from [[Mozilla]], [[Microsoft]], [[Samsung]] Electronics, [[Apple]], as well as various startups and invited experts.<ref name="webxr-wiki"></ref> | ||
In 2023, a significant milestone was reached when Apple announced WebXR support for its visionOS platform, which powers the Apple Vision Pro mixed reality headset. Initially, WebXR support in Safari for visionOS was available behind a feature flag while Apple collaborated with the W3C Immersive Web Working Group. | In 2023, a significant milestone was reached when Apple announced WebXR support for its visionOS platform, which powers the Apple Vision Pro mixed reality headset. Initially, WebXR support in Safari for visionOS was available behind a feature flag while Apple collaborated with the W3C Immersive Web Working Group.<ref name="apple-visionos-webxr"></ref> | ||
By early 2024, Apple expanded WebXR capabilities by adding support for the headset's natural input methods. In March 2024, visionOS 1.1 introduced support for gaze-and-pinch interactions in WebXR experiences, with Apple contributing a new "transient-pointer" input mode to the WebXR standard to accommodate these interactions. | By early 2024, Apple expanded WebXR capabilities by adding support for the headset's natural input methods. In March 2024, visionOS 1.1 introduced support for gaze-and-pinch interactions in WebXR experiences, with Apple contributing a new "transient-pointer" input mode to the WebXR standard to accommodate these interactions.<ref name="webkit-webxr-blog"></ref> | ||
With the announcement of visionOS 2 in mid-2024, Apple further committed to WebXR by making it enabled by default in Safari, eliminating the need for users to enable experimental feature flags. However, as of May 2025, WebXR on visionOS still only supports the immersive-vr session type, with the immersive-ar mode still in development. | With the announcement of visionOS 2 in mid-2024, Apple further committed to WebXR by making it enabled by default in Safari, eliminating the need for users to enable experimental feature flags. However, as of May 2025, WebXR on visionOS still only supports the immersive-vr session type, with the immersive-ar mode still in development.<ref name="immersiveweb"></ref> | ||
Ongoing efforts in the standard focus on improving performance, enhancing device compatibility, refining input methods, and expanding AR capabilities across platforms. | Ongoing efforts in the standard focus on improving performance, enhancing device compatibility, refining input methods, and expanding AR capabilities across platforms. | ||
Line 52: | Line 52: | ||
* '''inline''' - Renders XR content within an HTML element on a web page | * '''inline''' - Renders XR content within an HTML element on a web page | ||
* '''immersive-vr''' - Provides an exclusive, fully [[immersive VR]] experience | * '''immersive-vr''' - Provides an exclusive, fully [[immersive VR]] experience | ||
* '''immersive-ar''' - Blends virtual content with the real world environment | * '''immersive-ar''' - Blends virtual content with the real world environment<ref name="w3c-ar-module"></ref> | ||
====Reference Spaces==== | ====Reference Spaces==== | ||
Line 60: | Line 60: | ||
* '''local-floor''' - Like local, but with Y=0 at floor level | * '''local-floor''' - Like local, but with Y=0 at floor level | ||
* '''bounded-floor''' - A floor-relative space with defined boundaries | * '''bounded-floor''' - A floor-relative space with defined boundaries | ||
* '''unbounded''' - A space for world-scale AR experiences | * '''unbounded''' - A space for world-scale AR experiences<ref name="w3c-webxr"></ref> | ||
====Rendering Process==== | ====Rendering Process==== | ||
Line 68: | Line 68: | ||
#Delivering the combined framebuffer to the XR device for display | #Delivering the combined framebuffer to the XR device for display | ||
The API handles the complex timing and scheduling required for comfortable XR experiences, but does not directly manage 3D assets or perform | The API handles the complex timing and scheduling required for comfortable XR experiences, but does not directly manage 3D assets or perform rendering. That responsibility falls to WebGL or other graphics libraries.<ref name="mdn-fundamentals"></ref> | ||
====Input Handling==== | ====Input Handling==== | ||
Line 76: | Line 76: | ||
* Gaze-based input methods | * Gaze-based input methods | ||
* Natural input interactions (such as gaze-and-pinch on Apple Vision Pro) | * Natural input interactions (such as gaze-and-pinch on Apple Vision Pro) | ||
* Session-specific events (select, squeeze, etc.) | * Session-specific events (select, squeeze, etc.)<ref name="webxr-gamepads"></ref> | ||
===API Architecture=== | ===API Architecture=== | ||
Line 165: | Line 165: | ||
|} | |} | ||
Firefox provides partial WebXR support with ongoing development to expand capabilities. Safari on iOS does not support WebXR, but Safari on visionOS for Apple Vision Pro does support WebXR, with full immersive-vr mode support in visionOS 2 (enabled by default) and experimental work on immersive-ar mode in development. | Firefox provides partial WebXR support with ongoing development to expand capabilities. Safari on iOS does not support WebXR, but Safari on visionOS for Apple Vision Pro does support WebXR, with full immersive-vr mode support in visionOS 2 (enabled by default) and experimental work on immersive-ar mode in development.<ref name="caniuse-webxr"></ref> | ||
===Hardware Compatibility=== | ===Hardware Compatibility=== | ||
Line 174: | Line 174: | ||
*[[Tethered headsets]] ([[HTC Vive]], [[Oculus Rift]], etc.) | *[[Tethered headsets]] ([[HTC Vive]], [[Oculus Rift]], etc.) | ||
*[[Standalone headsets]] ([[Meta Quest]], [[HTC Vive Focus]], [[Apple Vision Pro]], etc.) | *[[Standalone headsets]] ([[Meta Quest]], [[HTC Vive Focus]], [[Apple Vision Pro]], etc.) | ||
*[[Mobile VR]] solutions ([[Google Cardboard]], etc.) | *[[Mobile VR]] solutions ([[Google Cardboard]], etc.)<ref name="immersiveweb"></ref> | ||
====AR Devices==== | ====AR Devices==== | ||
Line 182: | Line 182: | ||
===Input Mechanisms=== | ===Input Mechanisms=== | ||
WebXR supports various | WebXR supports various input methods based on device capabilities: | ||
* | * **Physical Controllers**: Traditional VR motion controllers with buttons, triggers, and thumbsticks | ||
* | * **Hand Tracking**: Natural hand movements and gestures | ||
* | * **Gaze-Based**: Targeting objects by looking at them | ||
* | * **Platform-Specific**: Such as Apple Vision Pro's gaze-and-pinch interaction system | ||
* | * **Hybrid Approaches**: Combinations of the above methods | ||
The | The "transient-pointer" input mode, introduced in 2024, enables more natural and privacy-preserving interaction methods that don't rely on persistent controller data. | ||
===Feature Detection and Fallbacks=== | ===Feature Detection and Fallbacks=== | ||
Line 197: | Line 197: | ||
* Feature detection to check if WebXR is supported in the current browser | * Feature detection to check if WebXR is supported in the current browser | ||
* The WebXR Polyfill that provides a fallback implementation for browsers without native support | * The WebXR Polyfill that provides a fallback implementation for browsers without native support | ||
* The WebXR API Emulator, a browser extension that simulates XR hardware for development and testing | * The WebXR API Emulator, a browser extension that simulates XR hardware for development and testing<ref name="mdn-startup"></ref> | ||
===Security Requirements=== | ===Security Requirements=== | ||
Line 204: | Line 204: | ||
* WebXR applications must be served over HTTPS or from localhost | * WebXR applications must be served over HTTPS or from localhost | ||
* Permission is required from the user before accessing XR devices | * Permission is required from the user before accessing XR devices | ||
* Additional user consent is required for features that access real-world information (like camera frames) | * Additional user consent is required for features that access real-world information (like camera frames)<ref name="w3c-ar-module"></ref> | ||
==Use Cases== | ==Use Cases== | ||
Line 212: | Line 212: | ||
*'''Virtual Tours''' - Museum exhibits, property showcases, and travel destinations | *'''Virtual Tours''' - Museum exhibits, property showcases, and travel destinations | ||
*'''[[Social VR]]''' - Virtual meeting spaces, collaborative environments, and social platforms | *'''[[Social VR]]''' - Virtual meeting spaces, collaborative environments, and social platforms | ||
*'''[[Therapeutic Application]]''' - Exposure therapy, pain management, and rehabilitation | *'''[[Therapeutic Application]]''' - Exposure therapy, pain management, and rehabilitation<ref name="caniuse-webxr"></ref> | ||
===Augmented Reality Applications=== | ===Augmented Reality Applications=== | ||
Line 219: | Line 219: | ||
*'''Navigation''' - Enhanced wayfinding, points of interest, and information overlays | *'''Navigation''' - Enhanced wayfinding, points of interest, and information overlays | ||
*'''[[Art]] and [[Culture]]''' - Interactive exhibits, enhanced performances, and public installations | *'''[[Art]] and [[Culture]]''' - Interactive exhibits, enhanced performances, and public installations | ||
*'''[[Education]]''' - Interactive learning materials, visualizations, and simulations | *'''[[Education]]''' - Interactive learning materials, visualizations, and simulations<ref name="google-webxr"></ref> | ||
===Cross-Reality Experiences=== | ===Cross-Reality Experiences=== | ||
Line 226: | Line 226: | ||
* Applications that adapt between VR and AR depending on available hardware | * Applications that adapt between VR and AR depending on available hardware | ||
* Collaborative experiences where some users are in VR and others in AR | * Collaborative experiences where some users are in VR and others in AR | ||
* Progressive experiences that start in 2D and can transition to immersive modes | * Progressive experiences that start in 2D and can transition to immersive modes<ref name="immersiveweb"></ref> | ||
==Development Tools and Frameworks== | ==Development Tools and Frameworks== | ||
Line 243: | Line 243: | ||
* '''[[WebXR Polyfill]]''' - JavaScript implementation for browsers without native support | * '''[[WebXR Polyfill]]''' - JavaScript implementation for browsers without native support | ||
* '''[[Mozilla WebXR Viewer]]''' - Experimental iOS app for testing WebXR content | * '''[[Mozilla WebXR Viewer]]''' - Experimental iOS app for testing WebXR content | ||
* '''[[WebXR Input Profiles]]''' - Repository of controller models and binding information | * '''[[WebXR Input Profiles]]''' - Repository of controller models and binding information<ref name="mdn-fundamentals"></ref> | ||
==Advantages and Limitations== | ==Advantages and Limitations== | ||
Line 341: | Line 341: | ||
<ref name="mdn-fundamentals">Mozilla Developer Network. (2023, February 19). Fundamentals of WebXR. MDN Web Docs. Retrieved May 6, 2025, from https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Fundamentals</ref> | <ref name="mdn-fundamentals">Mozilla Developer Network. (2023, February 19). Fundamentals of WebXR. MDN Web Docs. Retrieved May 6, 2025, from https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Fundamentals</ref> | ||
<ref name="webxr-gamepads">Immersive Web Working Group. (2023). WebXR Gamepads Module - Level 1. Retrieved May 6, 2025, from https://immersive-web.github.io/webxr-gamepads-module/</ref> | <ref name="webxr-gamepads">Immersive Web Working Group. (2023). WebXR Gamepads Module - Level 1. Retrieved May 6, 2025, from https://immersive-web.github.io/webxr-gamepads-module/</ref> | ||
<ref name="caniuse-webxr">Can I use. (2025, May). WebXR Device API. Retrieved May 6, 2025, from https://caniuse.com/webxr</ref> | <ref name="caniuse-webxr">Can I use. (2025, May). WebXR Device API. Retrieved May 6, 2025, from https://caniuse.com/webxr</ref> | ||
<ref name="immersiveweb">Immersive Web. (2025). Immersive Web Developer Home. Retrieved May 6, 2025, from https://immersiveweb.dev/</ref> | <ref name="immersiveweb">Immersive Web. (2025). Immersive Web Developer Home. Retrieved May 6, 2025, from https://immersiveweb.dev/</ref> | ||
Line 348: | Line 347: | ||
<ref name="apple-visionos-webxr">Apple Developer. (2024, June). WebXR for visionOS. Retrieved May 6, 2025, from https://developer.apple.com/documentation/webkit/webxr_for_visionos</ref> | <ref name="apple-visionos-webxr">Apple Developer. (2024, June). WebXR for visionOS. Retrieved May 6, 2025, from https://developer.apple.com/documentation/webkit/webxr_for_visionos</ref> | ||
<ref name="webkit-webxr-blog">WebKit Blog. (2024, March). Natural Input for WebXR on visionOS. Retrieved May 6, 2025, from https://webkit.org/blog/14142/natural-input-for-webxr-on-visionos/</ref> | <ref name="webkit-webxr-blog">WebKit Blog. (2024, March). Natural Input for WebXR on visionOS. Retrieved May 6, 2025, from https://webkit.org/blog/14142/natural-input-for-webxr-on-visionos/</ref> | ||
<ref name="w3c-webxr-history">World Wide Web Consortium. “WebXR Device API publication history.” W3C Standards. Retrieved May 6 2025, from https://www.w3.org/standards/history/webxr/</ref> | |||
</references> | </references> | ||