GithubHelp home page GithubHelp logo

isabella232 / webxr-layers-polyfill Goto Github PK

View Code? Open in Web Editor NEW

This project forked from immersive-web/webxr-layers-polyfill

0.0 0.0 0.0 142.48 MB

WebXR Layers Polyfill library. Lead: Rik Cabanier.

License: Apache License 2.0

JavaScript 60.53% TypeScript 39.47%

webxr-layers-polyfill's Introduction

webxr-layers-polyfill

A Javascript implementation of the WebXR Layers API, which renders layers in WebGL.

This polyfill only polyfills the Layers API; use the WebXR Polyfill to polyfill other WebXR features.

Setup

Download the polyfill from build/webxr-layers-polyfill.js and include it as a script tag.

<script src="webxr-layers-polyfill.js"></script>

Then, you will need to instantiate the polyfill in code before calling any XR code:

let layersPolyfill = new WebXRLayersPolyfill()

Building

The polyfill is written in Typescript and bundled with Rollup. Build with

$ npm run build

To run the examples, create a build, then run:

$ npm run serve

and point your web browser to http://localhost:8080/examples/layers-samples/.

What does it do?

The polyfill provides polyfilled classes for the new layer types defined in the WebXR Layers API, and modifies XRSession to use those polyfilled classes. The layers provide the WebGLTextures that the application renders into, then the polyfilled XRSession renders those layers onto an internal baseLayer. This baseLayer is then displayed in headset, in the same way that an XRSession without layers support would render it.

Not Supported

  • onredraw events for XRCubeLayer, XRCylinderLayer, XREquirectLayer, and XRQuadLayer are not implemented.
  • mipLevels - the polyfill ignores them, and assumes all layers are created without mipmaps.
  • Secondary views on XRProjectionLayer are ignored.

License

This program is free software for both commercial and non-commercial use, distributed under the Apache 2.0 license, which can be found in the LICENSE file.

webxr-layers-polyfill's People

Contributors

dmliao avatar cabanier avatar yonet avatar exponenta avatar abdullabest avatar

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.