Giter Club home page Giter Club logo

webxr-emulator-extension's Introduction

WebXR emulator extension

WebXR emulator extension is a browser extension which helps your WebXR content creation. It enables you to responsively run WebXR applications on your desktop browser without the need of any XR devices.

Blog post / YouTube / Slides (in Japanese)

Screenshot

Features

Status

Browsers

This extension is built on top of WebExtensions API. It works on Firefox, Chrome, and other browsers supporting the API.

How to use

  1. Go to the addon stores to install (Firefox, Chrome)

  2. Go to WebXR application page (for example WebXR examples). You will notice that the application detects that you have a XR device (emulated) and it will let you enter the immersive (VR、AR) mode.

  3. Open "WebXR" tab in the browser developer tool (Firefox, Chrome) to controll the emulated devices. You can move the headset and controllers, and trigger the controller buttons. You will see their transforms reflected in the WebXR application.

WebXR tab

How to control the emulated devices

By clicking a device in the devtool panel, you can select gizmo mode of the device. By dragging a gizmo, you can rotate or translate the device.

Configuration

You can configure some settings from the top in the WebXR tab.

Device

You can switch emulated device. The difference between devices is just degrees of freedom and the number of controllers for now.

Device Description
None No device
Google Cardboard 3dof headset and no controller
HTC Vive 6dof headset and two 6dof controllers
Oculus Go 3dof headset and 3dof controller
Oculus Quest 6dof headset and two 6dof controllers
Samsung Gear VR 3dof headset and 3dof controller

Stereo Effect

You can enable/disable Stereo Effect which renders two views.

AR mode

WebXR emulator extension also supports AR. You can test WebXR AR application on an emulated device in a virtual room, on your desktop browser.

Screenshot AR

How to use

  1. Download and manually install the newest extension from dev branch

  2. Select "Samsung Galaxy S8+ (AR)" device from the device list on the top of WebXR devtool panel

  3. Go to WebXR application page, for example Three.js WebXR AR examples

  4. You will notice that the application detects that you have a XR device (emulated) and it will let you enter the immersive (AR) mode

  5. AR application starts on the emulated device in a virtual room

How to control

You can control the camera (view) and tablet in the application window.

user action camera/tablet control
Left mouse button drag Camera rotation
Right mouse button drag Camera pan
Middle mouse button drag or wheel Move camera forward/backward
Mouse click on the tablet Change the tablet gizmo mode
Gizmo on the tablet Tablet rotation/translation
Right mouse button click on the tablet screen touch input

How to control in the devtool panel

You can still control the camera and tablet in the devtool panel similar to VR.

Devtool panel AR virtual room
Camera View
Right controller Finger (not shown in the application window)
Left controller Tablet

For development

How to install the newest version

If you want to develop or debug this extension or if you want to use the under development (not released yet) version, download this repositoy and install the extension into your browser as developer mode. (Firefox, Chrome)

How to build polyfill/webxr-polyfill.js

polyfill/webxr-polyfill.js is created with npm.

$ git clone https://github.com/MozillaReality/WebXR-emulator-extension.git
$ cd WebXR-emulator-extension
$ npm install
$ npm run build

Note

  • Even if native WebXR API is available the extension overrides it with WebXR polyfill

WebXR examples

Kudos

Thanks to WebVR-Extension project, it was a true inspiration for us when building this one.

License

Mozilla Public License Version 2.0

webxr-emulator-extension's People

Contributors

feiss avatar felixtrz avatar fernandojsg avatar gadhagod avatar jaeh avatar lojjic avatar mapopa avatar michaldybizbanski avatar takahirox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webxr-emulator-extension's Issues

Support WebXR Samples

Currently WebXR extension targets only Three.js VR examples for now (v0.1.0). So WebXR polyfill supports only part of WebXR APIs now.

I think WebXR Samples would be good as next target.

https://immersive-web.github.io/webxr-samples/

Most of the examples doesn't seem to work correctly with the extension now.

Maybe related to: #6

Icon

Make extension icon showing the right top in browser.

Add non-Oculus devices

Currently emulated devices are OculusGo and Quest. Users may think that this extension is Oculus device specific. To avoid such an impression, it may be good to add non-Oculus devices.

Make an instruction video

If we make an instruction video including

  • How to install
  • How to boot up
  • How to select devices
  • How to control devices
  • etc

users can easily understand

  • they don't need their own XR device
  • they can run WebXR application on desktop browser
  • what they can do with the extension
  • how to use
  • etc

Now we have animation gif in readme but perhaps it isn't good enough.

The video can be long so I'm thinking on uploading to YouTube (or somewhere). If we do so, should we upload to Mozilla Mixed Reality YouTube playlist?

When changing the device handle it properly

Currently when changing the device it doesn't seem to do anything, for example if I change from a device to none It should throw the events of device disconnected or so, so things updated around, or force the user to refresh the page or show one info message indicating it.

How to interact with native WebXR API supported by browser

Some WebXR API needs to recognize XR device, for example supportsSession(mode) checks if device supports the specified mode. Probably need to investigate how emulated XR device can be recognized by WebXR API supported by browser.

Improve controller and headset emulator UI

Currently controller emulator UI is

  • Space: Trigger button
  • Cursors: Controller rotation

But I think I can improve, for example using mouse or visualize as WebVR emulator does?

Doesn't work on the latest Chrome under origin trial

It seems the emulator doesn't work on the latest Chrome (Version 76.0.3809.100 (Official Build) (64-bit)) under origin trial.

The root issue seems that WebXR API is enabled by default and Chrome defines XR* (and navigator.xr) asynchronously. WebXR polyfill defines them synchronously and then they're overriden by Chrome later. (Currently) this extension can't interact with WebXR API defined by browser then fails to run.

Workaround for now may be disabling WebXR API via chrome://flags.

Maybe Related: #34

Update: I investigated the root issue and realized what I wrote above doesn't seem correct. It's actually that they're defined synchronously but done after "run_at": "document_start" of content scripts. So custom XR* defined in content scripts are overriden by browser. navigator.xr doesn't seem to be overriden.

Support left controller

Currently controller emulator only one controller (right controller). Supporting two controllers may be useful.

Store device transforms

Device transforms aren't stored so for example if you reopen development tool their transforms are reset to default. Storing/restoring them may be helpful.

Easily/Automatically enable/disable the extension

For cases where you maybe already have webxr in your system and want to use it instead of the extension. It could be nice to have it available on the pop up menu when clicking the extension icon

Where to render if canvas isn't appended

"1. Immersive VR Session" in https://immersive-web.github.io/webxr-samples/ tries to render only in XR device by setting session.updateRenderState({ baseLayer: new XRWebGLLayer(session, gl) }); and not appending the canvas to a page. Where should we render in immersive mode for such an application?

Currently we expect the canvas is appended to a page and render into it even in immersive mode. User can't see anything if the canvas isn't appended.

Do UX analysis

Josh do a UX analysis to figure out the UI we need for phase one of this project. Should include a mock-up if what it could look like.

Show whether controller button is being pressed or not

The controller button can have two status. The button is being pressed or not. But there is no change in "WebXR" panel in developer tool even if user presses/releases the button. I think it's helpful if user can know the button is being pressed or not. For example changing the controller color while button is being pressed?

Define device profiles at a single place

Currently device profiles are scattered across configuration.js, device-manager.js, and so on. Maybe better to define at a single place and refer from others.

Mouse controls

Currently user can control headset/controller only with keys. We may want to add mouse controls in which headset/controller follows mouse pointer.

Configuration doesn't work on Chrome

Error message.

Uncaught ReferenceError: browser is not defined

content-script.js:27 (anonymous function)

browser.storage.local.get(configurationId).then(result => {

Add non-stereo mode

Add non-stereo but controller activated mode. Maybe useful not to test but enjoy immersive application on desktop.

Add option to enable / disable or "solo" one of the devices

For example when working with a 6dof + 2x6dof controllers, a lot of arrows appear on the screen for all the gizmos and it's hard to choose the one you are interested, for example if you want to focus on the headest or one controller.
It could be nice to hide the other gizmos just by focusing on an actual device at time, ideally adding some shortcut too, like 1: headset, 2: controller1, 3: controller2 or so

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.