You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+34-32Lines changed: 34 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -483,6 +483,14 @@ When requested, the {{XRSession}} MUST <dfn>apply pending render states</dfn> by
483
483
1. If |newState|'s {{XRRenderStateInit/baseLayer}} is set, set |activeState|'s {{XRRenderState/baseLayer}} to |newState|'s {{XRRenderStateInit/baseLayer}}.
484
484
1. If |activeState|'s {{XRRenderState/inlineVerticalFieldOfView}} is less than |session|'s [=minimum inline field of view=] set |activeState|'s {{XRRenderState/inlineVerticalFieldOfView}} to |session|'s [=minimum inline field of view=].
485
485
1. If |activeState|'s {{XRRenderState/inlineVerticalFieldOfView}} is greater than |session|'s [=maximum inline field of view=] set |activeState|'s {{XRRenderState/inlineVerticalFieldOfView}} to |session|'s [=maximum inline field of view=].
486
+
1. Let |baseLayer| be |activeState|'s {{XRRenderState/baseLayer}}.
487
+
1. Set |activeState|'s [=XRRenderState/output canvas=] based on the following:
488
+
<dl class="switch">
489
+
<dt> If |baseLayer| is an instance of {{XRWebGLLayer}} with a [=XRWebGLLayer/use default framebuffer=] boolean set to <code>true</code>
490
+
<dd> Set |activeState|'s [=XRRenderState/output canvas=] to |baseLayer|'s {{XRWebGLLayer/context}}'s {{WebGLRenderingContext|canvas}}.
491
+
<dt> Otherwise
492
+
<dd> Set |activeState|'s [=XRRenderState/output canvas=] to <code>null</code>.
493
+
</dl>
486
494
487
495
</div>
488
496
@@ -560,18 +568,6 @@ The <dfn attribute for="XRSession">environmentBlendMode</dfn> attribute returns
560
568
561
569
NOTE: Most Virtual Reality devices exhibit {{XREnvironmentBlendMode/opaque}} blending behavior. Augmented Reality devices that use transparent optical elements frequently exhibit {{XREnvironmentBlendMode/additive}} blending behavior, and Augmented Reality devices that use passthrough cameras frequently exhibit {{XREnvironmentBlendMode/alpha-blend}} blending behavior.
562
570
563
-
Each {{XRSession}} has a <dfn for="XRSession">output canvas</dfn>, which is an {{HTMLCanvasElement}}. The [=XRSession/output canvas=] is the DOM element that will display any content rendered for an {{XRSessionMode/inline}}{{XRSession}}.
To determine the [=XRSession/output canvas=] for an {{XRSession}} |session|, the user agent MUST run the following steps:
568
-
569
-
1. Let |baseLayer| be |session|'s {{XRSession/renderState}}'s {{XRRenderState/baseLayer}}.
570
-
1. If |baseLayer| is an instance of an {{XRWebGLLayer}} with a [=XRWebGLLayer/use default framebuffer=] boolean set to <code>true</code>, return |baseLayer|'s {{XRWebGLLayer/context}}'s {{WebGLRenderingContext|canvas}}.
571
-
1. return <code>null</code>.
572
-
573
-
</div>
574
-
575
571
An {{XRSessionMode/inline}}{{XRSession}} is considered a <dfn for="XRSession">direct output session</dfn> if rendering commands performed for the {{XRSession}} are executed in such a way that they are directly displayed on the page, rather than being processed by the [=XR Compositor=].
Each {{XRRenderState}} has a <dfn for="XRRenderState">output canvas</dfn>, which is an {{HTMLCanvasElement}}. The [=XRRenderState/output canvas=] is the DOM element that will display any content rendered for an {{XRSessionMode/inline}}{{XRSession}}.
When an {{XRRenderState}} object is created for an {{XRSession}} |session|, the user agent MUST <dfn>initialize the render state</dfn> by running the following steps:
@@ -647,14 +645,15 @@ When an {{XRRenderState}} object is created for an {{XRSession}} |session|, the
647
645
<dd> Initialize |state|'s {{XRRenderState/inlineVerticalFieldOfView}} to <code>PI * 0.5</code>.
648
646
</dl>
649
647
1. Initialize |state|'s {{XRRenderState/baseLayer}} to <code>null</code>.
648
+
1. Initialize |state|'s [=XRRenderState/output canvas=] to <code>null</code>.
650
649
651
650
</div>
652
651
653
652
The <dfn attribute for="XRRenderState">depthNear</dfn> attribute defines the distance, in meters, of the near clip plane from the viewer. The <dfn attribute for="XRRenderState">depthFar</dfn> attribute defines the distance, in meters, of the far clip plane from the viewer.
654
653
655
654
{{XRRenderState/depthNear}} and {{XRRenderState/depthFar}} is used in the computation of the {{XRView/projectionMatrix}} of {{XRView}}s and determines how the values of an {{XRWebGLLayer}} depth buffer are interpreted. {{XRRenderState/depthNear}} MAY be greater than {{XRRenderState/depthFar}}.
656
655
657
-
The <dfn attribute for="XRRenderState">inlineVerticalFieldOfView</dfn> attribute defines the default vertical field of view in radians used when computing projection matrices for {{XRSessionMode/inline}}{{XRSession}}s. The projection matrix calculation also takes into account the aspect ratio of the [=XRSession/output canvas=]. This value MUST be <code>null</code> for [=immersive sessions=].
656
+
The <dfn attribute for="XRRenderState">inlineVerticalFieldOfView</dfn> attribute defines the default vertical field of view in radians used when computing projection matrices for {{XRSessionMode/inline}}{{XRSession}}s. The projection matrix calculation also takes into account the aspect ratio of the [=XRRenderState/output canvas=]. This value MUST be <code>null</code> for [=immersive sessions=].
658
657
659
658
Animation Frames {#animation-frames}
660
659
----------------
@@ -696,7 +695,7 @@ When an {{XRSession}} |session| receives updated [=viewer=] state from the [=/XR
696
695
697
696
1. If |session|'s [=list of pending render states=] is not empty, [=apply pending render states=].
698
697
1. If |session|'s {{XRSession/renderState}}'s {{XRRenderState/baseLayer}} is <code>null</code>, abort these steps.
699
-
1. If |session|'s [=XRSession/mode=] is {{XRSessionMode/"inline"}} and |session|'s [=XRSession/output canvas=] is <code>null</code>, abort these steps.
698
+
1. If |session|'s [=XRSession/mode=] is {{XRSessionMode/"inline"}} and |session|'s {{XRSession/renderState}}'s [=XRRenderState/output canvas=] is <code>null</code>, abort these steps.
700
699
1. Let |callbacks| be a list of the entries in |session|'s [=list of animation frame callback=], in the order in which they were added to the list.
701
700
1. Set |session|'s [=list of animation frame callbacks=] to the empty list.
702
701
1. Set |frame|'s [=active=] boolean to <code>true</code>.
@@ -1569,24 +1568,27 @@ The <dfn constructor for="XRWebGLLayer">XRWebGLLayer(|session|, |context|, |laye
1569
1568
1. If |context| is lost, throw an {{InvalidStateError}} and abort these steps.
1570
1569
1. If |context|'s [=XR compatible=] boolean is false, throw an {{InvalidStateError}} and abort these steps.
1571
1570
1. Initialize |layer|'s {{XRWebGLLayer/context}} to |context|.
1571
+
1. Initialize |layer|'s {{XRWebGLLayer/ignoreDepthValues}} as follows:
1572
+
<dl class="switch">
1573
+
<dt> If |layerInit|'s {{XRWebGLLayerInit/ignoreDepthValues}} value is <code>false</code> and the [=XR Compositor=] will make use of depth values
1574
+
<dd> Initialize |layer|'s {{XRWebGLLayer/ignoreDepthValues}} to <code>false</code>
1575
+
<dt> Otherwise
1576
+
<dd> Initialize |layer|'s {{XRWebGLLayer/ignoreDepthValues}} to <code>true</code>
1577
+
</dl>
1572
1578
1. Initialize |layer|'s [=XRWebGLLayer/use default framebuffer=] to |layerInit|'s {{XRWebGLLayerInit/useDefaultFramebuffer}}.
1573
-
1. If |layer|'s [=XRWebGLLayer/use default framebuffer=] boolean is <code>false</code>:
1574
-
1. Initialize |layer|'s {{XRWebGLLayer/antialias}} to |layerInit|'s {{XRWebGLLayerInit/antialias}} value.
1575
-
1. Initialize |layer|'s {{XRWebGLLayer/ignoreDepthValues}} as follows:
1576
-
<dl class="switch">
1577
-
<dt> If |layerInit|'s {{XRWebGLLayerInit/ignoreDepthValues}} value is <code>false</code> and the [=XR Compositor=] will make use of depth values
1578
-
<dd> Initialize |layer|'s {{XRWebGLLayer/ignoreDepthValues}} to <code>false</code>
1579
-
<dt> Otherwise
1580
-
<dd> Initialize |layer|'s {{XRWebGLLayer/ignoreDepthValues}} to <code>true</code>
1581
-
</dl>
1582
-
1. Initialize |layer|'s {{XRWebGLLayer/framebuffer}} to a new [=opaque framebuffer=] created with |context|.
1583
-
1. Initialize the |layer|'s [=swap chain=].
1584
-
1. If |layer|'s [=swap chain=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1585
-
1. Else if |layer|'s [=XRWebGLLayer/use default framebuffer=] boolean is <code>true</code>:
1586
-
1. If |session|'s [=mode=] is not {{XRSessionMode/inline}}, throw an {{InvalidStateError}} and abort these steps.
1. Initialize |layer|'s {{XRWebGLLayer/framebuffer}} to <code>null</code>.
1591
+
</dl>
1590
1592
1. Return |layer|.
1591
1593
1592
1594
</div>
@@ -1642,7 +1644,7 @@ The [=native WebGL framebuffer resolution=] is determined by running the followi
1642
1644
1643
1645
1. Let |session| be the target {{XRSession}}.
1644
1646
1. If |session|'s [=XRSession/mode=] value is not <code>"inline"</code>, set the [=native WebGL framebuffer resolution=] to the resolution required to have a 1:1 ratio between the pixels of a framebuffer large enough to contain all of the session's {{XRView}}s and the physical screen pixels in the area of the display under the highest magnification and abort these steps. If no method exists to determine the native resolution as described, the [=recommended WebGL framebuffer resolution=] MAY be used.
1645
-
1. Else the set the [=native WebGL framebuffer resolution=] to <code>1 x 1</code>.
1647
+
1. If |session|'s [=XRSession/mode=] value is <code>"inline"</code>, set the [=native WebGL framebuffer resolution=] to the size of the |session|'s {{XRSession/renderState}}'s [=XRRenderState/output canvas=] in physical display pixels and reevaluate these steps every time the size of the canvas changes or the [=XRRenderState/output canvas=] is changed.
0 commit comments