Skip to content

Add ignoreDepthValues attribute to the XRWebGLLayer #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 7, 2019

Conversation

toji
Copy link
Member

@toji toji commented Feb 28, 2019

Fixes #523.

This value instructs the UA to prevent the values left in the depth buffer after a frame is rendered for compositing. Slightly concerned about potential for confusion regarding the depth and ignoreDepthValues attributes being on the same dictionary, so clarifying bikeshedding is welcome there if you have suggestions.

Given the scope of the feature it felt appropriate to handle both the spec text and explainer text in the same PR. Please take a look!

Copy link
Member

@NellWaliczek NellWaliczek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty happy with this approach. I've added a few nitpicky bikeshedding questions that don't need to hold up approval.

@@ -689,6 +701,7 @@ dictionary XRWebGLLayerInit {
boolean depth = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per our conversation earlier about naming confusion... Perhaps these become "depthBuffer" or "alphaEnabled"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm highly reluctant to do so because currently these match, in both verbiage and function, the arguments from WebGL context creation exactly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. That makes sense...

@NellWaliczek NellWaliczek added this to the Next Working Draft milestone Mar 2, 2019
@toji toji added agenda Request discussion in the next telecon/FTF and removed agenda Request discussion in the next telecon/FTF labels Mar 4, 2019
toji added 3 commits March 6, 2019 22:31
This value instructs the UA to prevent the values left in the depth
buffer after a frame is rendered for compositing.
@toji toji force-pushed the ignore-depth-values branch from 469c18e to ee49bae Compare March 6, 2019 23:12
@toji
Copy link
Member Author

toji commented Mar 6, 2019

Updated this so that it also fixes #555, given that everybody seems to agree on it's interpretation. PTAL.

@thetuvix
Copy link
Contributor

thetuvix commented Mar 7, 2019

LGTM!

Per #555 (comment), if we also expect some WebXR content to start trying out reversed-Z, I wonder if we should also specify that UAs must allow depthNear to be greater than depthFar, to avoid some UAs failing to render some scenes.

@toji
Copy link
Member Author

toji commented Mar 7, 2019

Added line to the spec allowing depthNear to be greater than depthFar. And with that, and Nell's approval, I'm going to merge this.

@toji toji merged commit 8e234f2 into master Mar 7, 2019
@toji toji deleted the ignore-depth-values branch March 7, 2019 23:44
klausw added a commit to klausw/webxr that referenced this pull request Mar 26, 2019
For screen-based input, it seems overly specific to require that the ray origin must be at the near plane. If the system knows the actual position of the screen in 3D space, i.e. for a zSpace-style display or for smartphone AR, it would be preferable to use the actual mapping of the touch point into virtual world space for this. For example, if you use touch controls to add bubbles or other particle effects to the scene, it would look most natural to have those actually originate at the touched point.

As an additional complication, immersive-web#548 changed the core spec to explicitly allow reversed-Z where `depthFar` is less than `depthNear`. If the actual screen plane isn't available, it would be more consistent to use the closer of the two instead of always using `depthNear`.

As far as I can tell the spec itself doesn't currently require any particular depth for `XRTargetRayMode` `screen`.

See also https://github.com/immersive-web/webxr/issues/489#issuecomment-455291966 - I think it's problematic to assume that the screen plane corresponds to the near plane.
toji pushed a commit that referenced this pull request Mar 26, 2019
For screen-based input, it seems overly specific to require that the ray origin must be at the near plane. If the system knows the actual position of the screen in 3D space, i.e. for a zSpace-style display or for smartphone AR, it would be preferable to use the actual mapping of the touch point into virtual world space for this. For example, if you use touch controls to add bubbles or other particle effects to the scene, it would look most natural to have those actually originate at the touched point.

As an additional complication, #548 changed the core spec to explicitly allow reversed-Z where `depthFar` is less than `depthNear`. If the actual screen plane isn't available, it would be more consistent to use the closer of the two instead of always using `depthNear`.

As far as I can tell the spec itself doesn't currently require any particular depth for `XRTargetRayMode` `screen`.

See also https://github.com/immersive-web/webxr/issues/489#issuecomment-455291966 - I think it's problematic to assume that the screen plane corresponds to the near plane.
@AdaRoseCannon AdaRoseCannon added ed:spec Include in newsletter, spec change ed:explainer Include in newsletter, explainer change ed:feature Include in newsletter, adds a feature labels Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ed:explainer Include in newsletter, explainer change ed:feature Include in newsletter, adds a feature ed:spec Include in newsletter, spec change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants