Skip to content

Commit dadb198

Browse files
committed
Addressing some feedback
1 parent 2b7531c commit dadb198

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

index.bs

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,14 @@ When requested, the {{XRSession}} MUST <dfn>apply pending render states</dfn> by
483483
1. If |newState|'s {{XRRenderStateInit/baseLayer}} is set, set |activeState|'s {{XRRenderState/baseLayer}} to |newState|'s {{XRRenderStateInit/baseLayer}}.
484484
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=].
485485
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>
486494

487495
</div>
488496

@@ -560,18 +568,6 @@ The <dfn attribute for="XRSession">environmentBlendMode</dfn> attribute returns
560568

561569
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.
562570

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}}.
564-
565-
<div class="algorithm" data-algorithm="determine-output-canvas">
566-
567-
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-
575571
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=].
576572

577573
<div class="algorithm" data-algorithm="determine-direct-output-session">
@@ -632,6 +628,8 @@ dictionary XRRenderStateInit {
632628
};
633629
</pre>
634630

631+
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}}.
632+
635633
<div class="algorithm" data-algorithm="initialize-renderstate">
636634

637635
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
647645
<dd> Initialize |state|'s {{XRRenderState/inlineVerticalFieldOfView}} to <code>PI * 0.5</code>.
648646
</dl>
649647
1. Initialize |state|'s {{XRRenderState/baseLayer}} to <code>null</code>.
648+
1. Initialize |state|'s [=XRRenderState/output canvas=] to <code>null</code>.
650649

651650
</div>
652651

653652
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.
654653

655654
{{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}}.
656655

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=].
658657

659658
Animation Frames {#animation-frames}
660659
----------------
@@ -696,7 +695,7 @@ When an {{XRSession}} |session| receives updated [=viewer=] state from the [=/XR
696695

697696
1. If |session|'s [=list of pending render states=] is not empty, [=apply pending render states=].
698697
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.
700699
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.
701700
1. Set |session|'s [=list of animation frame callbacks=] to the empty list.
702701
1. Set |frame|'s [=active=] boolean to <code>true</code>.
@@ -1569,24 +1568,27 @@ The <dfn constructor for="XRWebGLLayer">XRWebGLLayer(|session|, |context|, |laye
15691568
1. If |context| is lost, throw an {{InvalidStateError}} and abort these steps.
15701569
1. If |context|'s [=XR compatible=] boolean is false, throw an {{InvalidStateError}} and abort these steps.
15711570
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>
15721578
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.
1587-
1. Initialize |layer|'s {{XRWebGLLayer/antialias}} to |layer|'s {{XRWebGLLayer/context}}'s [=actual context parameters=] {{WebGLContextAttributes|antialias}} value.
1588-
1. Initialize |layer|'s {{XRWebGLLayer/ignoreDepthValues}} to <code>true</code>.
1589-
1. Initialize |layer|'s {{XRWebGLLayer/framebuffer}} to <code>null</code>.
1579+
1. <dl class="switch">
1580+
<dt> If |layer|'s [=XRWebGLLayer/use default framebuffer=] boolean is <code>false</code>:
1581+
<dd>
1582+
1. Initialize |layer|'s {{XRWebGLLayer/antialias}} to |layerInit|'s {{XRWebGLLayerInit/antialias}} value.
1583+
1. Initialize |layer|'s {{XRWebGLLayer/framebuffer}} to a new [=opaque framebuffer=] created with |context|.
1584+
1. Initialize the |layer|'s [=swap chain=].
1585+
1. If |layer|'s [=swap chain=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1586+
<dt> Otherwise
1587+
<dd>
1588+
1. If |session|'s [=mode=] is not {{XRSessionMode/inline}}, throw an {{InvalidStateError}} and abort these steps.
1589+
1. Initialize |layer|'s {{XRWebGLLayer/antialias}} to |layer|'s {{XRWebGLLayer/context}}'s [=actual context parameters=] {{WebGLContextAttributes|antialias}} value.
1590+
1. Initialize |layer|'s {{XRWebGLLayer/framebuffer}} to <code>null</code>.
1591+
</dl>
15901592
1. Return |layer|.
15911593

15921594
</div>
@@ -1642,7 +1644,7 @@ The [=native WebGL framebuffer resolution=] is determined by running the followi
16421644

16431645
1. Let |session| be the target {{XRSession}}.
16441646
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.
16461648

16471649
</div>
16481650

0 commit comments

Comments
 (0)