From c2a745f1451c53c851c78873139143e867e74e40 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 23 Apr 2019 22:24:31 -0700 Subject: [PATCH 1/2] Explicitly specify how the views array is populated --- index.bs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 49e37f64..ea076088 100644 --- a/index.bs +++ b/index.bs @@ -389,6 +389,8 @@ enum XREnvironmentBlendMode { Each {{XRSession}} has a mode, which is one of the values of {{XRSessionMode}}. +The {{XRSession/viewerSpace}} on an {{XRSession}} has a list of views, which is a [=/list=] of [=view=]s corresponding to the views provided by the underlying device. +
To initialize the session, given |session| and |mode|, the user agent MUST run the following steps: @@ -687,6 +689,16 @@ When the getViewerPose(|referenceSpace|) method 1. If |frame|'s [=animationFrame=] boolean is false, throw an {{InvalidStateError}} and abort these steps. 1. Let |pose| be a new {{XRViewerPose}} object. 1. [=Populate the pose=] of |session|'s {{XRSession/viewerSpace}} in |referenceSpace| at the time represented by |frame| into |pose|. + 1. If |pose| is null return null. + 1. Let |xrviews| be an empty [=/list=]. + 1. For each [=view=] |view| in the [=XRSession/viewerSpace/list of views=] on the {{XRSession/viewerSpace}} of {{XRFrame/session}}, perform the following steps: + 1. Let |xrview| be a new {{XRView}} object. + 1. Initialize |xrview|'s {{XRView/eye}} to |view|'s [=view/eye=] + 1. Initialize |xrview|'s {{XRView/projectionMatrix}} to |view|'s [=view/projection matrix=] + 1. Let |offset| be an {{XRRigidTransform}} equal to the [=view offset=] of |view| + 1. Set |xrview|'s {{XRView/transform}} property to the result of [=multiply transforms|multiplying=] the |offset| transform by the {{XRViewerPose}}'s {{XRPose/transform}} + 1. [=list/Append=] |xrview| to |xrviews| + 1. Set |pose|'s {{XRViewerPose/views}} to |xrviews| 1. Return |pose|.
@@ -877,7 +889,15 @@ Views {#views} XRView {#xrview-interface} ------ -An {{XRView}} describes a single view into an XR scene. Each [=view=] corresponds to a display or portion of a display used by an XR device to present imagery to the user. They are used to retrieve all the information necessary to render content that is well aligned to the [=view=]'s physical output properties, including the field of view, eye offset, and other optical properties. [=Views=] may cover overlapping regions of the user's vision. No guarantee is made about the number of [=views=] any XR device uses or their order, nor is the number of [=views=] required to be constant for the duration of an {{XRSession}}. +An {{XRView}} describes a single view into an XR scene for a given frame. + +Each [=view=] corresponds to a display or portion of a display used by an XR device to present imagery to the user. They are used to retrieve all the information necessary to render content that is well aligned to the [=view=]'s physical output properties, including the field of view, eye offset, and other optical properties. [=Views=] may cover overlapping regions of the user's vision. No guarantee is made about the number of [=views=] any XR device uses or their order, nor is the number of [=views=] required to be constant for the duration of an {{XRSession}}. + +A [=view=] has an associated internal view offset, which is an {{XRRigidTransform}} describing the position and orientation of the [=view=] in the {{XRSession/viewerSpace}}'s [=coordinate system=]. + +A [=view=] has an associated projection matrixwhich is a [=matrix=] describing the projection to be used when rendering the [=view=], provided by the underlying XR device. The [=view/projection matrix=] MAY include transformations such as shearing that prevent the projection from being accurately described by a simple frustum. + +A [=view=] has an associated eyewhich is an {{XREye}} describing which eye this view is expected to be shown to. If the view does not have an intrinsically associated eye (the display is monoscopic, for example) this value MUST be set to {{XREye/"left"}}. NOTE: Many HMDs will request that content render two [=views=], one for the left eye and one for the right, while most magic window devices will only request one [=view=], but applications should never assume a specific view configuration. For example: A magic window device may request two views if it is capable of stereo output, but may revert to requesting a single view for performance reasons if the stereo output mode is turned off. Similarly, HMDs may request more than two views to facilitate a wide field of view or displays of different pixel density. @@ -894,9 +914,9 @@ enum XREye { }; -The eye attribute describes which eye this view is expected to be shown to. This attribute's primary purpose is to ensure that pre-rendered stereo content can present the correct portion of the content to the correct eye. If the view does not have an intrinsically associated eye (the display is monoscopic, for example) this attribute MUST be set to {{XREye/"left"}}. +The eye attribute describes is the [=view/eye=] of the underlying [=view=]. This attribute's primary purpose is to ensure that pre-rendered stereo content can present the correct portion of the content to the correct eye. -The projectionMatrix attribute provides a [=matrix=] describing the projection to be used when rendering the [=view=]. It is strongly recommended that applications use this matrix without modification or decomposition. The {{projectionMatrix}} MAY include transformations such as shearing that prevent the projection from being accurately described by a simple frustum. Failure to use the provided projection matrices when rendering may cause the presented frame to be distorted or badly aligned, resulting in varying degrees of user discomfort. +The projectionMatrix attribute is the [=view/projection matrix=] of the underlying [=view=]. It is strongly recommended that applications use this matrix without modification or decomposition. Failure to use the provided projection matrices when rendering may cause the presented frame to be distorted or badly aligned, resulting in varying degrees of user discomfort. The transform attribute is the {{XRRigidTransform}} of the viewpoint. From 5bcadcddce616d5eac8dd14cdc3dc0ab4e09af5a Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 30 Apr 2019 13:48:53 -0700 Subject: [PATCH 2/2] underlying device -> XR device --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index ea076088..23588c1d 100644 --- a/index.bs +++ b/index.bs @@ -389,7 +389,7 @@ enum XREnvironmentBlendMode { Each {{XRSession}} has a mode, which is one of the values of {{XRSessionMode}}. -The {{XRSession/viewerSpace}} on an {{XRSession}} has a list of views, which is a [=/list=] of [=view=]s corresponding to the views provided by the underlying device. +The {{XRSession/viewerSpace}} on an {{XRSession}} has a list of views, which is a [=/list=] of [=view=]s corresponding to the views provided by the [=/XR device=].