immersive-web / depth-sensing

Specification: https://immersive-web.github.io/depth-sensing/ Explainer: https://github.com/immersive-web/depth-sensing/blob/main/explainer.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add depthNear and depthFar to XRDepthInformation

cabanier opened this issue · 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

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

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.

@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.

/agenda add depthNear and depthFar to XRDepthInformation

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

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.

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.