XRWebGLLayer

Draft
This page is not complete.

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The XRWebGLLayer interface of the WebXR Device API provides a framebuffer that is compatible for binding with a WebGLRenderingContext.

Constructor

XRWebGLLayer.XRWebGLLayer()
Creates a new XRWebGLLayer object.

Properties

XRWebGLLayer.antialias
Indicates whether the target framebuffer supports antialiasing.
XRWebGLLayer.framebuffer
Returns an instance of WebGLFramebuffer that can be bound to a WebGLRenderingContext. Its size cannot be adjusted after the XRWebGLLayer is created.
XRWebGLLayer.framebufferWidth
Returns the height of the framebuffer.
XRWebGLLayer.framebufferHeight
Returns the width of the framebuffers.
XRWebGLLayer.ignoreDepthValues
Indicates whether the content of the depth buffer attachment is used by the XR compositor.

Methods

XRWebGLLayer.getViewport()
Returns a new XRViewport instance containing dimensions for the current viewport.
XRWebGLLayer.getNativeFramebufferScaleFactor()
Returns the value that the session’s recommended WebGL framebuffer resolution must be multiplied by to yield the session’s native WebGL framebuffer resolution.

Specifications

Specification Status Comment
WebXR Device API
The definition of 'XRWebGLLayer' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
XRWebGLLayerChrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
XRWebGLLayer() constructorChrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
antialiasChrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
framebufferChrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
framebufferHeightChrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
framebufferWidthChrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
getNativeFramebufferScaleFactor()Chrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
getViewport()Chrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
ignoreDepthValuesChrome Full support 79Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support

See also