immersive-web / immersive-web/layers

Width and height of XRQuadLayer are actually half width and half height

Open
#324 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
96
Forks
19
PR merge metrics
No merged PRs in 30d

Description

According to the WebXR Layers API spec the width and height of an XRQuadLayer are the dimension of the layer in meters. In practice however it seems that they are "half" width and height. From the center position of the layer, the quad extends width to the left and right, and height up and down. Resulting in a 2 * width by 2 * height quad.

This can be observed with the Meta Quest Browser on Quest devices, as well as with the webxr-layers-polyfill. Not sure if there are other XR devices/browsers implementing it this way or if they implement it according to the spec.

Spec

The width and height attributes set and return the width and height of the layer in meters.

(Source: https://www.w3.org/TR/webxrlayers-1/#dom-xrquadlayer-width)

Usages

Various libraries and frameworks already account for this discrepancy when creating layers:

Ideally the implementation(s) would be fixed so that the width and height properties match the actual dimensions. Though, given the above list, it might be easier to change the wording in the spec instead.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the WebXR Layers API specification's XRQuadLayer width and height definition with the linked webxr-layers-polyfill quad-renderer.ts and WebXR Samples quad-ab-test.html. Check the referenced Three.js and A-Frame layer creation code to understand the existing workaround, then determine whether the repository should clarify the specification or coordinate an implementation fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.