diff --git a/index.bs b/index.bs index d827c33..e2737d4 100755 --- a/index.bs +++ b/index.bs @@ -33,6 +33,8 @@ spec: WebGL 2.0; urlPrefix: https://www.khronos.org/registry/webgl/specs/latest/ for: GLenum; type: dfn; text: R32F; url: 3.7 type: typedef; text: TEXTURE_2D_ARRAY; url: 3.7 + for: GLenum; + type: dfn; text: R16UI; url: 3.7 spec: WebXR Layers; urlPrefix: https://www.w3.org/TR/webxrlayers-1/# type: dfn; text: opaque texture; url: opaque-texture type: dfn; text: session; for: XRWebGLBinding; url: xrwebglbinding-session @@ -159,12 +161,13 @@ enum XRDepthUsage { -- A data format of "luminance-alpha" indicates that items in the depth data buffers obtained from the API are 2-byte unsigned integer values. -- A data format "float32" indicates that items in the depth data buffers obtained from the API are 4-byte floating point values. +- A data format of "luminance-alpha" or "unsigned-short" indicates that items in the depth data buffers obtained from the API are 16 bit unsigned integer values. +- A data format "float32" indicates that items in the depth data buffers obtained from the API are 32 bit floating point values. The following table summarizes the ways various data formats can be consumed: @@ -182,17 +185,24 @@ The following table summarizes the ways various data formats can be consumed: {{XRDepthDataFormat/"luminance-alpha"}} [=GLenum/LUMINANCE_ALPHA=] - 2 bytes + 2 times 8 bit Interpret {{XRCPUDepthInformation/data}} as {{Uint16Array}} Inspect Luminance and Alpha channels to reassemble single value. {{XRDepthDataFormat/"float32"}} [=GLenum/R32F=] - 4 bytes + 32 bit Interpret {{XRCPUDepthInformation/data}} as {{Float32Array}} Inspect Red channel and use the value. + + {{XRDepthDataFormat/"unsigned-short"}} + [=GLenum/R16UI=] + 16 bit + Interpret {{XRCPUDepthInformation/data}} as {{Uint16Array}} + Inspect Red channel and use the value. + @@ -228,14 +238,26 @@ When an {{XRSession}} is created with depth sensing enabled, the {{XRSession/dep In order to find supported configuration combination for depth sensing API given |usagePreference| and |dataFormatPreference| sequences, the user agent MUST run the following algorithm: 1. Let |selectedUsage| be null. - 1. For each |usage| in |usagePreference| sequence, perform the following steps: - 1. If |usage| is not considered a supported depth sensing usage by the [=native depth sensing=] capabilities of the device, continue to the next entry. - 1. Set |selectedUsage| to |usage| and abort these nested steps. + 1. Initialize |selectedUsage| as follows: +
+
If the |usagePreference| sequence is empty +
Initialize |selectedUsage| to the device's [=preferred native depth sensing capability=]. +
Otherwise +
For each |usage| in |usagePreference| sequence, perform the following steps: + 1. If |usage| is not considered a supported depth sensing usage by the [=native depth sensing=] capabilities of the device, continue to the next entry. + 1. Set |selectedUsage| to |usage| and abort these nested steps. +
1. If |selectedUsage| is null, return null and abort these steps. 1. Let |selectedDataFormat| be null. - 1. For each |dataFormat| in |dataFormatPreference|, perform the following steps: - 1. If |selectedUsage|,|dataFormat| is not considered a supported depth sensng usage and data format combination by the [=native depth sensing=] capabilities of the device, continue to the next entry. - 1. Set |selectedDataFormat| to |dataFormat| and abort these nested steps. + 1. Initialize |selectedDataFormat| as follows: +
+
If the |usagePreference| sequence is empty +
Initialize |selectedDataFormat| to the device's [=preferred native depth sensing format=]. +
Otherwise +
For each |dataFormat| in |dataFormatPreference|, perform the following steps: + 1. If |selectedUsage|,|dataFormat| is not considered a supported depth sensng usage and data format combination by the [=native depth sensing=] capabilities of the device, continue to the next entry. + 1. Set |selectedDataFormat| to |dataFormat| and abort these nested steps. +
1. If |selectedDataFormat| is null, return null and abort these steps. 1. Return |selectedUsage|,|selectedDataFormat|. @@ -630,12 +652,14 @@ The device can support depth sensing usage in 2 ways. If the device i Note: The user agent can choose to support both usage modes (e.g. when the device is capable of providing both CPU- and GPU-accessible data, or by performing the transfer between CPU- and GPU-accessible data manually). -The device can support depth sensing data format given depth sensing usage in the following ways. If, given the depth sensing usage, the device is able to return depth data as a buffer containing 2-byte unsigned integers, it is said to support {{XRDepthDataFormat/"luminance-alpha"}} data format. If, given the depth sensing usage, the device is able to return depth data as a buffer containing 4-byte floating point values, it is said to support {{XRDepthDataFormat/"float32"}} data format. +The device can support depth sensing data format given depth sensing usage in the following ways. If, given the depth sensing usage, the device is able to return depth data as a buffer containing 16 bit unsigned integers, it is said to support the {{XRDepthDataFormat/"luminance-alpha"}} or {{XRDepthDataFormat/"unsigned-short"}} data format. If, given the depth sensing usage, the device is able to return depth data as a buffer containing 32 bit floating point values, it is said to support the {{XRDepthDataFormat/"float32"}} data format. The device is said to support depth sensing usage and data format combination if it supports depth sensing usage and supports depth sensing data format given the specified usage. Note: the support of depth sensing API is not limited only to hardware classified as AR-capable, although it is expected that the feature will be more common in such devices. VR devices that contain appropriate sensors and/or use other techniques to provide depth buffer should also be able to provide the data necessary to implement depth sensing API. +The device MUST have a preferred [=native depth sensing=] capability that MUST be used if the {{XRDepthStateInit/usagePreference}} array is empty, and a preferred [=native depth sensing=] format that MUST be used if the {{XRDepthStateInit/dataFormatPreference}} array is empty. The capability and format SHOULD reflect the most efficient ones of the device. + Privacy & Security Considerations {#privacy-security}