SANTHOSH-SJ / Simple-WebXR-Unity

Bring WebXR to Unity 3D with 3 files !

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

See the simple demo : https://rufus31415.github.io/sandbox/simple-webxr-unity/

More about WebXR : https://rufus31415.github.io/tag/WebXR/

Unity version : 2018.4.21f1

This prototype shows a simple implementation of WebXR with Unity 3D. The project is compiled in WebGL and is based on ~250 lines of code divided into 3 files :

  • SimpleWebXR.cs: Behaviour that displays the "Start AR" button and writes the position of the hand camera.
  • SimpleWebXR.jslib: Javascript plugin that is included in the application and that makes the link between the Unity engine and the WebXR session. It displays the rendering and obtains the positions and characteristics of the camera.
  • SimpleWebXR.jspre: Javascript plugin executed before the application that initializes a number of things.

This example works on devices that support WebXR ('immersive-ar' and 'immersive-vr'). Devices with 1 view (known as magic windows like smartphones) or with 2 views (stereo, one for each eyes, like Hololens, Quest, Vive...) are supported.

Tested on:

Working on controllers and hand support...

Here are the resources that allowed me to move forward with this project:

Feel free to open issues :)

About

Bring WebXR to Unity 3D with 3 files !

License:MIT License


Languages

Language:C# 41.4%Language:CSS 23.1%Language:HTML 19.1%Language:JavaScript 16.4%