Skip to content

Inconsistent frambuffer width and height behaviour of XRWebGLLayer #1410

Open
@mrxz

Description

@mrxz

The following snippet seems to behave differently between the browser on the Apple Vision Pro and the Quest Browser:

let glLayer = new XRWebGLLayer(session, gl);
session.updateRenderState({ baseLayer: glLayer });
console.log(glLayer.framebufferWidth, glLayer.framebufferHeight);

On the quest browser it reports the actual framebuffer dimensions, whereas on the AVP it reports 1x1 initially. The values are correct in subsequent animation frames. This causes issues in Three.js as it stores the framebuffer size directly after creating the base layer.

From what I understand from the spec the framebuffer is created as part of the XRWebGLLayer constructor (https://immersive-web.github.io/webxr/#dom-xrwebgllayer-xrwebgllayer). At that point the framebuffer dimensions should be known and can thus be reflected in the framebufferWidth/Height properties. The spec also makes it clear that the framebuffer size can not be adjusted by the developer, though no mention if the WebXR implementation may adjust it on the fly or not.

Is the above snippet supposed to reliably report the framebuffer dimensions? Or are user agents allowed to adjust the framebuffer size on the fly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions