immersive-web / depth-sensing

Specification: https://immersive-web.github.io/depth-sensing/ Explainer: https://github.com/immersive-web/depth-sensing/blob/main/explainer.md
Other
52 stars 15 forks source link

Add depthNear and depthFar to XRDepthInformation #43

Open cabanier opened 9 months ago

cabanier commented 9 months ago

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

bialpio commented 8 months ago

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:

cabanier commented 8 months ago

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

alcooper91 commented 8 months ago

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.

cabanier commented 8 months ago

@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 commented 7 months ago

/agenda add depthNear and depthFar to XRDepthInformation

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

bialpio commented 6 months ago

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.

cabanier commented 6 months ago

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.