Giter VIP home page Giter VIP logo

webxr-api's Introduction

(obsolete) webxr-api

This repository contains a draft proposal and starting point for discussing WebXR that we created in the fall of 2017, to explore what it might mean to expand WebVR to include AR/MR capabilities.

The WebVR community has shifted WebVR in this direction. The group is now called the Immersive Web Community Group and the WebVR specification has now become the WebXR Device API.

We will not be updating this site any longer, although we will continue to experiment with the webxr-polyfill we created when we created this API specification, until there is a complete WebXR polyfill. At that point we expect to shift our experiments to the new polyfill.

(old README, for historical purposes)

In order to make progress on defining WebXR, we are creating a proposal for this capability. The api is intended to build on the concepts already included in the native WebVR implementation, or the WebVR polyfill, but extend them with AR capabilities appropriate for the underlying platform.

The initial interface draft is in WebXR API.md.

A polyfill and example code using this draft WebXR API is available in the webxr-polyfill repository.

There is also a primer on using the WebXR APIs.

We maintain a list of changes we made to the WebVR 2.0 draft to create the WebXR draft.

Some of the concepts we believe are important to have in WebXR include:

  • The ability to have control the render of reality inside the browser, as this is essential for enabling user privacy (e.g. controlling camera and location data), easy cross platform applications, and performance.

  • Making access to video frames and other "world knowledge" up to the user-agent, so they may require permission from user for access to these resources.

  • Supporting the potential for multiple simultaneous AR pages, where each page knows that they are rendering on top of reality and if they have focus. Supporting these lines up with the ability to render reality inside the browser since each application would not be responsible for rendering the view of reality, so their content could be composited.

  • Supporting some form of the idea of “custom, user defined” representations of reality like fully virtual realities. The critical feature is that the "reality" code can “filter” the view pose that is passed back into the rAF callback, both in the same page and in other pages (if there is multi-page support).

  • Some ability to do high performance, synchronous computer vision in a mix of native and javascript. One approach is to have a synchronous vision worker that is executed before the rAF callback happens, but there are other approaches.

webxr-api's People

Contributors

blairmacintyre avatar dmarcos avatar joshmarinacci avatar mozilla-github-standards avatar mrdoob avatar trevordev avatar trevorfsmith 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  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-api's Issues

Supporting Computer Vision

We will want to allow people to write their own CV code and run it synchronously with WebXR. They may want to parallelize, but we might be able to just keep it simple.

For a while, we were talking about possibly exposing something like OpenVX (https://www.khronos.org/openvx/) so that apps could initialize native "CV graphics" in JS, but they would run nativing, with the option of adding "nodes" in JS/WebAssembly. We might still want to do that, but this might actually be a separate thing that somehow synchronizes with WebXR.

The basic requirement is that whatever data the platform can provide (and that the UA/user allows access to) gets passed to a method written in JS/WebAssembly. I'm not sure the "best" way to implement this (in polyfill or natively), but the idea of "Vision Workers" was floated by some folks. If we could have efficient shared buffers and worker sync, we could let users set up a worker, WebXR could pass it data and then call the program's rAF, the program would sync up with the worker as late as it can (allowing parallelization) and then get the data.

An initialize implementation would have us put JSARToolkit in a worker and pass WebRTC video frames to it.

Answering "for magic window, do we still need sessions that just wants sensor data?"

In WebXR API.md the question is asked:

'exclusive' needs to be rethought given the new use of XRDisplay for magic window. Do we still need sessions that just wants sensor data?

I think the answer is yes, because we need a way for the UA to control if/when the display/app gets sensor data. This is a discussion in WebVR: how can "magic window" apps get sensor input that might be sensitive (i.e., can be used for user profiling, tracking, etc) with/without user acknowledgment.

So, I would think that app has to ask, and the UA can then mediate.

More care, and control, over what WebRTC reality we get

navigator.mediaDevices.getUserMedia({
audio: false,
video: { facingMode: "environment" }

If we look at JSARToolkit, AR.js and argon.js's WebRTC reality, all attempt to constrain the selection of the reality. Mostly, they try to find a relatively low res (~320x240) if available. One question, of course, is if we need that: is it the case that we can render the video to any sized canvas we want, so we can display at high res and (if we want to do tracking) get the pixels at lower res?

This might (also) be an example of where we'd want to have a "platform specific extenstion API" to manager WebRTC video. In addition to choosing cameras or resolutions, this might also let us (for example) connect to a remote video stream and do AR on it, or run off a remote file. Neither of the later of these is urgent, but selecting cameras might be. And, more importantly, if continues to force us to deal with "platform specifics".

Stages, Anchors and Reference Frames

During a recent chat, we got to discussing Anchors and reference frames and the differences between how WindowsMR/Hololens does things and how more stationary VR devices (Vive, etc) think about this.

Here, we've been thinking about how all of these might be unified under some notions of Coordinate Systems and Anchors. We were thinking about having some "well defined" Anchors or coordinate frames, such as "stage" or "body" or perhaps "leftHand", for devices that support them. I'd really like to try and understand better how far folks think this can be pushed, and what the "minimums" need to support. It would be great if some others who've been thinking about this issue (@toji, @bferns, @judax, @NellWaliczek,@RafaelCintron, etc) might chime in. I'd like to capture some of it.

system state should be exposed as events

I'd like to put a dialog on top of the screen which says to move around until the system is fully initalized and found the floor anchor. Currently there is no API to get this. I can sort of do it by querying for the floor anchor and seeing what I get back, but this doesn't feel reliable becuase I can't tell if the anchor is valid. We should expose the state of the system through a series of events, similar to how XMLHttpRequest gives you detailed events for different parts of a request.

Wiki changes

FYI: The following changes were made to this repository's wiki:

These were made as the result of a recent automated defacement of publically writeable wikis.

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

Declarative?

Do the ideas here include a declarative (HTML) language for 3D?

How should we support platform specific APIs?

We've talked about it, here and there. Over time we will expose more and more "generic" APIs that we think can be supported in many places (e.g., perhaps plane detection).

But, to explicitly control the platform, there will be some custom APIs needed

  • ADF control on Tango (and probably ARCore), similar but different ideas on WindowsMR, probably something similar when ARKit matures.
  • loading image targets or models on platforms with those kinds of trackers.
  • etc

Should we assume webxr.platform.name as a set of namespaces and go from there?

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.