web api interface
XRRenderState
Secure contextLimited availability
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.
Instance properties
baseLayerRead only Experimental- : The
XRWebGLLayerfrom which the browser’s compositing system obtains the image for the XR session.
- : The
depthFarRead 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.
depthNearRead 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.
inlineVerticalFieldOfViewRead only Experimental- : The default vertical field of view, defined in radians, to use when the session is in
inlinemode.nullfor all immersive sessions.
- : The default vertical field of view, defined in radians, to use when the session is in
layersRead only Experimental- : An ordered array containing
XRLayerobjects that are displayed by the XR compositor.
- : An ordered array containing
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.