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

Immersive VR request not sent #203

Closed
2 of 6 tasks
TiborUdvari opened this issue Feb 27, 2024 · 5 comments
Closed
2 of 6 tasks

Immersive VR request not sent #203

TiborUdvari opened this issue Feb 27, 2024 · 5 comments

Comments

@TiborUdvari
Copy link
Collaborator

Nature of issue?

  • Found a bug
  • Existing feature enhancement
  • New feature request

Which area does this problem relate to?

  • VR
  • AR(ARCORE)
  • AR(MARKER)

Details about the bug:

  • p5.js version: 1.5.0
  • Device Name: - Meta Quest 3
  • Web browser and version: Meta Quest Browser version 31.4.0.5 ( Chromium version 120.0 )
  • Operating System: Quest Version 62.0.0
  • Steps to reproduce this:
WhatsApp.Video.2024-02-27.at.16.15.57.mp4

The immersive-vr request session is never being called, because this.hasImmersive is never set.

if (this.hasImmersive) {
  console.log('Requesting session with mode: immersive-vr');
  this.isImmersive = true;
  this.resetXR();
  navigator.xr
    .requestSession('immersive-vr')
    .then(this.__startSketch.bind(this));
} else {
  this.xrButton.hide();
}

I think it should be updated in __sessionCheck() like this:

const supported = await navigator.xr.isSessionSupported(session);
this.hasImmersive = supported; 
this.xrButton.setAvailable(supported, mode);

I can submit a PR, if you think this is the correct way to handle it.

stalgiag added a commit that referenced this issue Mar 9, 2024
Fix not requesting VR immersive mode fixes #203
@JuanIrache
Copy link

Has this been merged to the CDN version used in the public examples? I cannot get them running in a Quest 3, whereas other general Webxr examples seem to run well.

Thanks

@stalgiag
Copy link
Owner

Has this been merged to the CDN version used in the public examples? I cannot get them running in a Quest 3, whereas other general Webxr examples seem to run well.

Thanks

Hi! The NPM package has been updated. I am not sure how long it will take the CDN to update the cached library but this fix has been pushed.

TiborUdvari added a commit to TiborUdvari/p5.xr that referenced this issue Apr 7, 2024
WebGL2 support and p5.instance.webglVersion check was introduced in
version 1.7.0 https://github.com/processing/p5.js/releases/tag/v1.7.0.
Getting webgl context will fail if in older versions. Example mentioned
in stalgiag#203 currently fails because of this
@TiborUdvari
Copy link
Collaborator Author

@JuanIrache there was also a problem with the texture in this example for some reason, could you try out the example here? https://editor.p5js.org/TiborUdvari/sketches/fgA0L9jQ6

@JuanIrache
Copy link

@JuanIrache there was also a problem with the texture in this example for some reason, could you try out the example here? https://editor.p5js.org/TiborUdvari/sketches/fgA0L9jQ6

It loads, but the entire room is upside down. I'm not sure if that's intentional

@TiborUdvari
Copy link
Collaborator Author

There was a rotate(PI); in the code, I removed it now, I'm not sure why it was in the original example. It should be okay now.

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

No branches or pull requests

3 participants