Skip to content
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

WebXR: Don't request hand-tracking feature by default. #27699

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 7, 2024

Fixed #27698.

Description

This PR ensures VRButtons.createButton() gets the sessionInit parameter like XRButton and ARButton.

Besides, the optional feature hand-tracking is not requested by default anymore to avoid unnecessary permission prompts in visionOS.

/cc @cabanier

@cabanier
Copy link
Contributor

cabanier commented Feb 7, 2024

Yes, this is fine

@Mugen87 Mugen87 added this to the r162 milestone Feb 8, 2024
@Mugen87 Mugen87 merged commit 477bff7 into mrdoob:dev Feb 8, 2024
11 checks passed
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 8, 2024

Noted this change in the migration guide for r162: https://github.com/mrdoob/three.js/wiki/Migration-Guide#r161--r162

@mrdoob
Copy link
Owner

mrdoob commented Feb 9, 2024

But... How do we select/drag anything (create input events) on VisionOS if it's not with hand-tracking?

If we go into a WebXR session and we can't create any event... The only use case I can think of is watching a immersive video but we wouldn't even have controls for it.

@@ -85,7 +85,11 @@

container.appendChild( renderer.domElement );

document.body.appendChild( VRButton.createButton( renderer ) );
const sessionInit = {
optionalFeatures: [ 'hand-tracking' ]
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, yeah... I guess in the handinput examples it should be requiredFeatures?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 9, 2024

But... How do we select/drag anything (create input events) on VisionOS if it's not with hand-tracking? If we go into a WebXR session and we can't create any event... The only use case I can think of is watching a immersive video but we wouldn't even have controls for it.

/ping @m-blix

@Mugen87 Mugen87 mentioned this pull request Feb 9, 2024
@cabanier
Copy link
Contributor

cabanier commented Feb 9, 2024

But... How do we select/drag anything (create input events) on VisionOS if it's not with hand-tracking?

If we go into a WebXR session and we can't create any event... The only use case I can think of is watching a immersive video but we wouldn't even have controls for it.

That doesn't work on Vision Pro anyway since Safari doesn't create events for hands. I'm unsure why they made that decision but it's unlikely to change.
Instead, they added support for transient-pointer in VisionOS 1.1 which is now in beta. That works without WebXR Hands and lets you select with your eyes and hands. Quest Browser has a version of it behind a flag.

If you turn on WebXR hands on Vision OS 1.1, you may get 3 or 4 controllers (2 hands and 1/2 transient controllers). This is not supported by three at the moment since it only looks at the first 2 input sources.
I'm unsure if Quest browser will add support for this because regular controller input works better.

@mrdoob
Copy link
Owner

mrdoob commented Feb 14, 2024

That doesn't work on Vision Pro anyway since Safari doesn't create events for hands. I'm unsure why they made that decision but it's unlikely to change. Instead, they added support for transient-pointer in VisionOS 1.1 which is now in beta. That works without WebXR Hands and lets you select with your eyes and hands. Quest Browser has a version of it behind a flag.

Sounds like we're going to have to rework all this 😔

@cabanier
Copy link
Contributor

Sounds like we're going to have to rework all this 😔

I'm trying to clean up the spec so it's not as confusing but am getting pushback: immersive-web/webxr#1358 (comment)

@zalo
Copy link
Contributor

zalo commented Jun 4, 2024

Just stubbed my toe on Apple's transient-pointer stuff today with an OpenXR update I'm making to LeapShape:
https://zalo.github.io/LeapShape/

It's fine if they want their special transient pointers which work without hand tracking, but then they should also fire polyfilled events on the hands when they are granted so everybody else's apps aren't broken.

They even cited three.js as not supporting their just-invented "spec" in their FAQ instead of submitting any PRs to fix it:

When hand-tracking is enabled I can’t select anything.
Your experience probably is only looking at events which correspond to the first two inputs in the inputSources array. Many examples in the popular framework Three.js only act on events related to inputs at index 0 and 1. When hand tracking is enabled, the inputs corresponding to the hand tracking data appear in entries 0 and 1 but the transient-pointer style inputs appear in entries 2 and 3.

Identifying potential issues in existing WebXR scenes
WebXR is provided in visionOS 1.1 for testing purposes only. If you encounter bugs in the browser, please don’t attempt to target a user-agent string to work around them. Instead, report them to us via Feedback Assistant.

Hah! If you don't want workarounds, don't ship intentionally broken products and leave them that way for four months!

I'm going to look into submitting a PR later that explores polyfilling the missing input logic and perhaps adding a framerate up-interpolator for their janky 30hz tracking so hands work better in three.js than their own native apps.

I'm also thinking about contributing the PinchMoveControls from LeapShape to three.js as a more general camera/locomotion system (now that the camera parenting bug has been fixed...).

@mrdoob
Copy link
Owner

mrdoob commented Jun 5, 2024

@zalo amazing stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants