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

WebXRManager: Inherit active layers from camera #29742

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Oct 24, 2024

Fixed #24354

Description

This PR updates the WebXRManager to copy over the layers mask to the XR cameras. The respective eye layer (1 for left, 2 for right) is always enabled in addition.

  • A default scene setup behaves identical to before
  • Calling renderer.render(scene, camera) now always respects camera.layers whether XR is active or not
  • Users that manually enabled layers on the XR cameras will now have to enable them on the main camera instead.
  • Users will have to be careful with layers 1 and 2 as these are used for the eyes (even before this PR)

This contribution is funded by Fern Solutions

Copy link

��� Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 691.57
171.41
691.6
171.42
+26 B
+9 B
WebGPU 818.87
220.85
818.87
220.85
+0 B
+0 B
WebGPU Nodes 818.38
220.72
818.38
220.72
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 463.72
112.16
463.75
112.17
+26 B
+8 B
WebGPU 539.75
145.78
539.75
145.78
+0 B
+0 B
WebGPU Nodes 495.74
135.6
495.74
135.6
+0 B
+0 B
@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 26, 2024

/cc @cabanier

@Mugen87 Mugen87 added this to the r170 milestone Oct 26, 2024
@jrjdavidson
Copy link
Contributor

Just in case it's useful, see #26340

@Mugen87 Mugen87 merged commit 6c231d8 into mrdoob:dev Oct 28, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants