大网数据广告活动
Web 标准与前端开发

XRRenderState

· 52CE 我爱测

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 fie

WebXR

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 XRSession.updateRenderState, the specified changes take effect after the current animation frame has completed, but before the next one begins.

Instance properties

  • XRRenderState.baseLayer
    • : The XRWebGLLayer from which the browser's compositing system obtains the image for the XR session.
  • XRRenderState.depthFar
    • : 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
    • : 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
    • : 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
    • : An ordered array containing XRLayer objects that are displayed by the XR compositor.

Specifications

Browser compatibility

See also

  • XRSession.renderState
  • XRSession.updateRenderState()
  • XRSystem.requestSession

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。