immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
381 stars 84 forks source link

Initial XRSession.renderState shouldn't be null #98

Closed takahirox closed 4 years ago

takahirox commented 4 years ago

If I understand the WebXR API spec correctly, the initial renderState of XRSession should be a new XRRenderState instance.

https://immersive-web.github.io/webxr/#xrsession-interface

Each XRSession has an active render state which is a new XRRenderState,

The renderState attribute returns the XRSession's active render state.

But in webxr-polyfill it's initialized as null.

I tested with the following code and I get the different result between on Canary and on webxr-polyfill.

navigator.xr.requestSession('inline').then(session => {
  // XRRenderState instance on Canary WebXR while null on webxr-polyfill
  console.log(session.renderState);
});
takahirox commented 4 years ago

Closing in favor of #99