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
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -245,7 +245,7 @@ If the depth sensing feature is a required feature but the application did not s
245
245
246
246
If the depth sensing feature is a required feature but the result of <a lt="find supported configuration combination">finding supported configuration combination</a> algorithm invoked with {{XRDepthStateInit}} is <code>null</code>, the user agent MUST treat this as an unresolved required feature and reject the {{XRSystem/requestSession(mode, options)}} promise with a {{NotSupportedError}}. If it was requested as an optional feature, the user agent MUST ignore the feature request and not enable depth sensing on the newly created session.
247
247
248
-
When an {{XRSession}} is created with depth sensing enabled, the {{XRSession/depthUsage}}, {{XRSession/depthDataFormat}}, and {{XRSession/depthType}} attributes MUST be set to the result of <a lt="find supported configuration combination">finding supported configuration combination</a> algorithm invoked with {{XRDepthStateInit}}.
248
+
When an {{XRSession}} is created with depth sensing enabled, the {{XRSession/depthUsage}}, {{XRSession/depthDataFormat}}, and {{XRSession/depthType}} attributes MUST be set to the result of <a lt="find supported configuration combination">finding supported configuration combination</a> algorithm invoked with {{XRDepthStateInit}}.{{XRSession/depthActive}} SHOULD default to <code>true</code>.
249
249
250
250
Note: The intention of the algorithm is to process preferences from most restrictive to least restrictive. Thus, we begin processing items where only a single item is indicated, then multiple, and finally where no preference is indicated.
@@ -310,6 +311,8 @@ The {{XRSession/depthDataFormat}} describes depth sensing data format with which
310
311
311
312
The {{XRSession/depthType}} describes the depth sensing type with which the session was configured. If this attribute is accessed on a session that does not have depth sensing enabled, the user agent MUST throw an {{InvalidStateError}}. If the runtime only supports a single {{XRDepthType}} or otherwise ignored {XRDepthStateInit/depthTypeRequest}} this may return <code>null</code>.
312
313
314
+
The {{XRSession/depthActive}} describes and attempts to set the current [=depth sensing active state=]. If this attribute is accessed or attempted to be set on a session that does not have depth sensing enabled, the user agent MUST throw an {{InvalidStateError}}. If the user agent or device does not support this attribute, they should return <code>null</code> on getting, and setting should be a <code>no-op</code>. Setting {{XRSession/depthActive}} to null should be a <code>no-op</code>. While the value is set immediately, it may be an indeterminate amount of frames before the user agent is able to begin returning depth data again when changing from <code>false</code> to <code>true</code>. It is up to the user agent to determine the most appropriate way to stop processing depth data when this is set to <code>true</code>.
315
+
313
316
Obtaining depth data {#obtaining-data}
314
317
====================
315
318
@@ -421,6 +424,7 @@ In order to <dfn>create a CPU depth information instance</dfn> given {{XRFrame}}
421
424
1. Let |time| be |frame|'s [=XRFrame/time=].
422
425
1. Let |session| be |frame|'s {{XRFrame/session}}.
423
426
1. Let |device| be the |session|'s [=XRSession/XR device=].
427
+
1. If {{XRSession/depthActive}} is <code>false</code>, return <code>null</code> and abort these steps.
424
428
1. Let |nativeDepthInformation| be a result of querying |device| for the depth information valid as of |time|, for specified |view|, taking into account |session|'s {{XRSession/depthType}}, {{XRSession/depthUsage}}, and {{XRSession/depthDataFormat}}.
425
429
1. If |nativeDepthInformation| is <code>null</code>, return <code>null</code> and abort these steps.
426
430
1. If the depth buffer present in |nativeDepthInformation| meets user agent's criteria to [=block access=] to the depth data, return <code>null</code> and abort these steps.
@@ -520,6 +524,7 @@ In order to <dfn>create a WebGL depth information instance</dfn> given {{XRFrame
520
524
1. Let |time| be |frame|'s [=XRFrame/time=].
521
525
1. Let |session| be |frame|'s {{XRFrame/session}}.
522
526
1. Let |device| be the |session|'s [=XRSession/XR device=].
527
+
1. If {{XRSession/depthActive}} is <code>false</code>, return <code>null</code> and abort these steps.
523
528
1. Let |nativeDepthInformation| be a result of querying |device|'s [=native depth sensing=] for the depth information valid as of |time|, for specified |view|, taking into account |session|'s {{XRSession/depthType}}, {{XRSession/depthUsage}}, and {{XRSession/depthDataFormat}}.
524
529
1. If |nativeDepthInformation| is <code>null</code>, return <code>null</code> and abort these steps.
525
530
1. If the depth buffer present in |nativeDepthInformation| meets user agent's criteria to [=block access=] to the depth data, return <code>null</code> and abort these steps.
@@ -684,6 +689,8 @@ Note: the support of depth sensing API is not limited only to hardware classifie
684
689
685
690
For each of {{XRDepthStateInit/depthTypeRequest}}, {{XRDepthStateInit/usagePreference}}, and {{XRDepthStateInit/dataFormatPreference}}, The device MUST have a <dfn>preferred [=native depth sensing=] capability</dfn> that MUST be used if the corresponding array is empty. The type, usage, and format SHOULD reflect the most efficient ones of the device, though they may be dependent upon each other.
686
691
692
+
The device can be said to have a <dfn>depth sensing active state</dfn>, which represents if depth sensing capabilities are actively running. This state may either be "started" (<code>true</code>) or "stopped" (<code>false</code>), and should begin as "started". If the native device cannot simulate this state, the user agent can simply not process any depth data when the state is otherwise "stopped".
0 commit comments