This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The XRRenderState interface of the WebXR Device API contains configurable values which affect how the imagery generated by an XRSession gets composited. These properties include the range of distances from the viewer within which content should be rendered, the vertical field of view (for inline presentations), and a reference to the XRWebGLLayer being used as the target for rendering the scene prior to it being presented on the XR device's display or displays.
When you apply changes using the XRSession method updateRenderState(), the specified changes take effect after the current animation frame has completed, but before the next one begins.
XRRenderState.baseLayer Read only Experimental
The XRWebGLLayer from which the browser's compositing system obtains the image for the XR session.
XRRenderState.depthFar Read only Experimental
The distance, in meters, of the far clip plane from the viewer. The far clip plane is the plane which is parallel to the display beyond which rendering of the scene no longer takes place. This, essentially, specifies the maximum distance the user can see.
XRRenderState.depthNear Read only Experimental
The distance, in meters, of the near clip plane from the viewer. The near clip plane is the plane, parallel to the display, at which rendering of the scene begins. Any closer to the viewer than this, and no portions of the scene are drawn.
XRRenderState.inlineVerticalFieldOfView Read only Experimental
The default vertical field of view, defined in radians, to use when the session is in inline mode. null for all immersive sessions.
XRRenderState.layers Read only Experimental
An ordered array containing XRLayer objects that are displayed by the XR compositor.
| Specification |
|---|
| WebXR Device API> # xrrenderstate-interface> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
XRRenderState |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 12.0 | No | No |
baseLayer |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 12.0 | No | No |
depthFar |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 12.0 | No | No |
depthNear |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 12.0 | No | No |
inlineVerticalFieldOfView |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 12.0 | No | No |
layers |
No | No | No | No | No | No | No | No | No | No | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRRenderState