Skip to content

WebXRManager: Disable left eye layer for right eye camera and vice versa #31437

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Jul 17, 2025

Related issue: #31434

Description

Since #29742, layers enabled on the camera are inherited by the XR cameras. In addition, the special layers (1 and 2) are enabled for the left and right camera respectively.

This PR changes the logic slightly so that it not only enables the eye layers, but explicitly disables the eye layer for the other eye. This way the left eye camera will never render with the right eye layer and vice versa. Before this change that could still happen when the camera had these layers enabled.

This contribution is funded by Fern Solutions

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.01
78.83
337.99
78.83
-12 B
-2 B
WebGPU 557.92
154.36
557.92
154.36
+0 B
+0 B
WebGPU Nodes 556.84
154.16
556.84
154.16
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.26
113.53
469.25
113.53
-12 B
-2 B
WebGPU 633.22
171.39
633.22
171.39
+0 B
+0 B
WebGPU Nodes 588.35
160.71
588.35
160.71
+0 B
+0 B

@Mugen87 Mugen87 added this to the r179 milestone Jul 17, 2025
@Mugen87 Mugen87 merged commit 3ffaf70 into mrdoob:dev Jul 17, 2025
9 checks passed
Mugen87 added a commit that referenced this pull request Jul 27, 2025
@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 27, 2025

FYI: Added this change to XRManager (WebGPURenderer) as well: f614ed3

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.

2 participants