-
Notifications
You must be signed in to change notification settings - Fork 399
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
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. That makes sense...
This value instructs the UA to prevent the values left in the depth buffer after a frame is rendered for compositing.
469c18e
to
ee49bae
Compare
Updated this so that it also fixes #555, given that everybody seems to agree on it's interpretation. PTAL. |
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 |
Added line to the spec allowing |
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.
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.
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
andignoreDepthValues
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!