0% found this document useful (0 votes)
17 views13 pages

WebXR Integration with Unity 2020

The document outlines a project integrating Unity with WebXR to enable immersive VR/AR experiences directly in web browsers without native applications. It discusses the technologies used, including Unity Engine, WebXR Device API, and WebGL, along with the architecture and key components of the implementation. The project successfully demonstrates various interactive demos, highlights challenges faced, and suggests future enhancements for AR capabilities and performance optimization.

Uploaded by

marijuana0726
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views13 pages

WebXR Integration with Unity 2020

The document outlines a project integrating Unity with WebXR to enable immersive VR/AR experiences directly in web browsers without native applications. It discusses the technologies used, including Unity Engine, WebXR Device API, and WebGL, along with the architecture and key components of the implementation. The project successfully demonstrates various interactive demos, highlights challenges faced, and suggests future enhancements for AR capabilities and performance optimization.

Uploaded by

marijuana0726
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd

Simple-WebXR-Unity

Powered by Unity and WebXR

AR/VR Presentation : Madhav Kumar (22CD3017) -CSD(3rd Year)


Mentor Name : Dr Susham Biswas
Content
List of Sections

Introduction to WebXR and Unity


Technologies Utilized
Unity and WebXR ( Architecture Overview)
Key Components
Challenges Faced
Results & Observations
Future Scope
Conclusion
Introduction to WebXR and Unity
Purpose of the Project:

WebXR: A web API that enables immersive experiences (VR/AR)


directly in web browsers without additional installations.
Unity: A powerful game engine widely used for creating 3D and 2D
games and simulations.
Purpose of the Project:
1. Integrate Unity 3D applications with WebXR.
2. Enable VR/AR experiences on web platforms without native apps.
Technologies Used
A High level Overview of what Technology I used :

Unity Engine: Primary development platform.


WebXR Device API: Facilitates VR/AR experiences in browsers.
WebGL: Renders interactive 3D graphics within browsers.
C# Scripting: Handles application logic within Unity.
JavaScript Bridge: Connects Unity's C# code with the WebXR API.
Browser Support: Chrome, Oculus Browser, Firefox Reality
Architecture Overview
Unity Scene: Developed using Unity's editor.
WebGL Build: Exports the Unity project for web compatibility.
JavaScript Bridge: [Link] connects Unity's C# code to the WebXR API.
Browser Execution: Runs the WebGL build, enabling VR/AR experiences directly in the browser.

Unity scene + WebXR runtime


Communication via:
WebXR JavaScript API
[Link] (C# <-> JS bridge)
WebGL builds serve HTML/JS assets using Unity’s WebGL template system

Breaks an image into [Unity Scene] → [WebGL Build] → [JavaScript Bridge] → [WebXR API] → [Browser Execution]
Key Components
1. [Link]: Main C# script interfacing with WebXR
functionalities.
2. [Link]: JavaScript library bridging Unity and WebXR.
3. Demo Scenes: Located in
SimpleWebXR-Demo/Assets/SimpleWebXR/ Scenes/, showcasing various
WebXR capabilities.
4. MRTK Integration: Enhances Mixed Reality Toolkit with WebXR
support.

5. [Link] – main handler for WebXR events


Demo scenes: show VR and AR rendering, controller tracking
Input simulation via JS for browser testing
Result and Live Demo

Successful Integration:Unity
applications can now run VR/AR
experiences directly in browsers.
Result and Live Demo

Interactive Demos:Various demos showcase capabilities


like hand tracking, controller input, and spatial interactions.
User Accessibility: Users can access immersive
experiences
Experiment & Implementation
Build in Unity 2020+ with WebGL as
target
Used browser emulator plugin for local
testing
Scenes tested:
Immersive VR on Oculus Browser
AR pass-through on Hololens (limited)
Input mapping: Unity’s XR Input System
translated to WebXR controller schema
Which Model is
Challenges Faced
better
Comparison of ResNet and
Browser Compatibility: Inconsistent WebXR support across different
ViT
browsers and devices.
ViT achieved higher overall
accuracy (90.07%) compared
Performance Issues: Rendering complex scenes in browsers can lead
to ResNet (89.38%).
to performance bottlenecks.
ViT model has better
macro-averaged F1 Score
Debugging Difficulties: Interfacing between C# and JavaScript adds
(90.0%) than ResNet (89.21%).
complexity to debugging processes.
ViT performed more
consistently across all
Limited AR Support: Unity's WebGL build has constraints that affect
classes, especially
AR functionalities. for difficult
categories like Viral
Pneumonia.
ResNet still performed very
strongly for Tuberculosis and
Corona Virus Disease detection
Future Scope
Enhanced AR Features: Expand AR capabilities within Unity's
WebGL builds.
Performance Optimization: Improve rendering efficiency for
complex scenes.
Broader Device Support: Ensure compatibility with a wider range of
devices and browsers.
Community Contributions: Encourage open-source contributions to
further develop the project.
THANK YOU
THANK YOU

Common questions

Powered by AI

Several challenges were noted during the implementation of WebXR in Unity applications. Browser compatibility posed significant challenges due to inconsistent WebXR support across various browsers and devices. This inconsistency affects the user experience as not all browsers can uniformly support WebXR. Performance issues emerged particularly when rendering complex scenes, which often results in bottlenecks causing inefficiencies. Debugging was complicated by the need to interface between C# and JavaScript, increasing the complexity of identifying and solving issues. Additionally, there were limitations in AR support because of constraints within Unity's WebGL build, impacting the effectiveness of AR functionalities .

SimpleWebXR's components play critical roles in facilitating the development of VR/AR experiences within Unity applications. SimpleWebXR.cs acts as the main C# script that interfaces directly with WebXR functionalities, handling events and processes necessary for running VR/AR environments. SimpleWebXR.jslib serves as a JavaScript library that forms the bridge between Unity's environment and the capabilities provided by the WebXR API. This connectivity allows for the execution of VR/AR processes in web browsers by translating Unity's complex environments and interactions into a format that browsers can execute, ultimately supporting the deployment of immersive experiences without dedicated native applications .

Within Unity's architecture for browser-based VR/AR experiences, WebGL is crucial as it allows for the rendering of interactive 3D graphics, enabling Unity scenes to be visualized in web browsers. Unity exports projects as WebGL builds which are essential for web compatibility, thereby facilitating the transition from development to live execution in browsers. The JavaScript Bridge, particularly embodied by SimpleWebXR.jslib, connects Unity's C# code with the WebXR Device API, enabling seamless communication and execution of WebXR commands. This bridge is pivotal in supporting runtime VR/AR functionalities, as it allows the integration of Unity's complex logic with the browser's execution environment to render immersive experiences .

The main technologies used for integrating Unity 3D applications with the WebXR API are the Unity Engine, WebXR Device API, WebGL, C# scripting, and a JavaScript Bridge. The Unity Engine serves as the primary development platform for creating the 3D environments. The WebXR Device API allows for VR/AR experiences directly in web browsers. WebGL renders interactive 3D graphics essential for displaying these environments in browsers. C# scripting addresses the application logic within Unity, and the JavaScript Bridge connects Unity's C# code to the WebXR API, enabling seamless execution of VR/AR experiences in browsers .

The demo scenes showcased successful integration and operational capabilities of Unity applications running VR/AR experiences directly in browsers. These interactive demos highlighted functionalities such as hand tracking, controller input processing, and spatial interactions. Users were able to access immersive experiences without needing native applications, demonstrating the capability and accessibility provided by the integration. This setup also facilitated testing across different scenes, like immersive VR in Oculus Browser and AR pass-through on Hololens, albeit with some limitations .

The Unity's XR Input System plays a crucial role in mapping Unity's input handling to the WebXR controller schema, which is essential for managing user interactions within VR/AR environments. It provides a framework for integrating diverse input sources, such as various VR controllers, to ensure they work smoothly in browser-based VR/AR applications. By translating input commands to be consistent with the WebXR framework, it enhances user interactions by allowing natural and responsive action within the immersive experiences. This is crucial for maintaining an engaging and intuitive user interface, which is fundamental for user immersion and experience satisfaction in VR/AR applications .

To address challenges and expand the future scope of WebXR-supported Unity applications, the project plans to enhance AR features by expanding the capabilities of Unity's WebGL builds, which are currently limited in supporting full AR functionalities. Performance optimization is another focus area, aiming to improve the rendering efficiency for complex scenes, which should alleviate the existing performance bottlenecks. The project also seeks to increase compatibility across a wider range of devices and browsers to overcome the current inconsistencies in WebXR support. Additionally, encouraging community contributions through open-source development is envisaged to foster innovation and further development of WebXR capabilities within Unity projects .

To overcome the inconsistencies in WebXR compatibility across different platforms, the project has planned to broaden device and browser support. This involves ensuring that the WebXR capabilities are consistent across various environments, emphasizing more robust compatibility checks and possibly developing additional layers of abstraction or emulation. Additionally, there may be efforts to engage with browser developers to address specific shortcomings in current WebXR implementations. By establishing a more versatile compatibility framework, it would enable a wider audience to access WebXR experiences reliably from different devices and platforms, improving overall user reach and application effectiveness .

The limitations in AR functionalities observed in Unity's WebGL builds primarily affect the deployment and scalability of AR experiences. These constraints may stem from the WebGL build's inability to fully utilize AR device features or efficiently render complex AR scenes directly in browsers. As a result, the richness and interactivity of AR experiences can be compromised, affecting user engagement and satisfaction. Such limitations can also elevate the technical complexity required in the development phase, requiring workarounds or additional development efforts to realize the intended AR functionalities within browser environments .

The key difference in performance between the ViT and ResNet models was in their overall accuracy and consistency across categories. ViT achieved a higher overall accuracy of 90.07% compared to ResNet's 89.38%. Additionally, ViT had a better macro-averaged F1 Score of 90.0% compared to ResNet's 89.21%. ViT's consistency across all classes, especially in difficult categories such as Viral Pneumonia, suggests it may be more reliable under variable conditions. However, ResNet performed very strongly in detecting Tuberculosis and Corona Virus Disease, indicating its robustness in specific applications. These performance differences influence model selection based on specific detection needs, with ViT potentially offering broader and more consistent applicability .

You might also like