Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Apr 6, 2023

Description

Adds a new XRButton class which creates a immersive-ar or a immersive-vr session depending on availability.

This allows making projects that run in passthrough headsets and also on vr headsets.

Side note:
I wonder if it was a mistake to call immersive-ar to the session that mobile phones support.
Maybe it should have been called mobile-ar?

/cc @toji @cabanier @elalish

@mrdoob mrdoob added this to the r152 milestone Apr 6, 2023
@github-actions
Copy link

github-actions bot commented Apr 6, 2023

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize Gzipped Diff from dev
633.7 kB 157 kB +88 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize Gzipped Diff from dev
424.9 kB 103 kB +88 B

Copy link
Contributor

@cabanier cabanier left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@cabanier cabanier left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@cabanier cabanier left a comment

Choose a reason for hiding this comment

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

Most of these experiences are VR only. Maybe there should be a way to prefer VR instead of AR for such sites.

@mrdoob
Copy link
Owner Author

mrdoob commented Apr 6, 2023

What makes you think they are VR only?

The problem is that I've not figured out how to make the background transparent without passing alpha: true to the renderer yet 😅

WIP

@cabanier
Copy link
Contributor

cabanier commented Apr 7, 2023

What makes you think they are VR only?

The problem is that I've not figured out how to make the background transparent without passing alpha: true to the renderer yet 😅

Can you not set a background? WebXR are cleared to transparent black.

@mrdoob
Copy link
Owner Author

mrdoob commented Apr 11, 2023

Ok, figured it out...
Turns out there was some code around for it already.

@mrdoob mrdoob marked this pull request as ready for review April 11, 2023 07:58
@mrdoob mrdoob merged commit de2fbc6 into dev Apr 11, 2023
@mrdoob mrdoob deleted the xrbutton branch April 11, 2023 08:31
@cabanier
Copy link
Contributor

So this is a new button that prefers AR mode? If so LGTM

Copy link
Contributor

@cabanier cabanier left a comment

Choose a reason for hiding this comment

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

LGTM. It doesn't look like I have permission to officially sign off

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

Successfully merging this pull request may close these issues.

3 participants