depth-sensing icon indicating copy to clipboard operation
depth-sensing copied to clipboard

Add depthNear and depthFar to XRDepthInformation

Open cabanier opened this issue 2 years ago • 8 comments

I noticed that the IDL for XRDepthInformation in Chromium has depthNear and depthFar but they are not defined in the spec. @bialpio, should we document those? OpenXR depth sensing also exposes them so it seems they're needed.

/agenda add depthNear and depthFar to XRDepthInformation

cabanier avatar Oct 11 '23 22:10 cabanier

Sorry, I missed this initially - can you share a link to where you see those defined in Chromium's IDLs? I cannot seem to find it in depth-related IDLs. I checked:

  • https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/xr/xr_cpu_depth_information.idl
  • https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/xr/xr_depth_information.idl
  • https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/xr/xr_webgl_depth_information.idl

bialpio avatar Oct 17 '23 16:10 bialpio

oops. Sorry, I added those in our repo :-) Let me follow up if they're needed.

cabanier avatar Oct 17 '23 17:10 cabanier

Correlating what piotr says, I'm only seeing depthNear and depthFar defined for XrRenderState(Init), which is specced: https://immersive-web.github.io/webxr/#xrrenderstate-interface, in case you maybe had some inheritance chain somewhere.

alcooper91 avatar Oct 26 '23 16:10 alcooper91

@bialpio @alcooper91 we need to communicate the near and far clip plane that were used for the depth texture to the session. Otherwise we can't line them up perfectly. The OpenXR API even provides the fov but I'm unsure if we need to communicate that.

cabanier avatar Oct 26 '23 21:10 cabanier

/agenda add depthNear and depthFar to XRDepthInformation

We need to convey the same clipping planes that were used for computation of the depth texture

cabanier avatar Nov 28 '23 18:11 cabanier

Is it just to convey the clipping planes, or is it going to also need to change our existing text around what the values are? Here is what we currently say:

  1. For on-CPU data: "The data is stored in row-major format, without padding, with each entry corresponding to distance from the view's near plane to the users' environment, in unspecified units." - link.
  2. For on-GPU data: "Each texel corresponds to distance from the view's near plane to the users' environment, in unspecified units." - link.

If it's just to convey the clipping planes used, then I'm not too worried. Otherwise (i.e. if you actually put values into the depth buffer that represent the distance from a near plane that's different than XRView's), I think it's going to be a breaking change.

bialpio avatar Dec 12 '23 18:12 bialpio

Is it just to convey the clipping planes, or is it going to also need to change our existing text around what the values are?

It is just to convey the clipping planes. We want to matches the projection matrices that are used in the immersive scene with the ones that were used to calculate the depth.

cabanier avatar Dec 12 '23 18:12 cabanier

This is not resolved yet. I will publish a PR by TPAC and hopefully I can get the engineer on the line

/tpac add depth near/far + a pose

cabanier avatar Sep 10 '24 20:09 cabanier