Skip to content

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jan 17, 2025

Related issue: #28968

Description

A first version of XRManager with basic WebXR support.

Features like layers, WEBGL_multisampled_render_to_texture or depth sensing are missing and can be added with subsequent PRs.

Tested with a Quest 2. The demo does not fully work when running the demo on Android as an AR demo, yet. I suspect We must apply some array-camera related changes to get that bit right.

Copy link

github-actions bot commented Jan 17, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.53
79.09
336.25
78.28
-3.27 kB
-819 B
WebGPU 493.59
137.22
503.11
139.72
+9.53 kB
+2.5 kB
WebGPU Nodes 493.05
137.12
502.58
139.61
+9.53 kB
+2.5 kB

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.25
112.11
465.25
112.13
+0 B
+20 B
WebGPU 563.97
152.82
576.89
156.36
+12.93 kB
+3.54 kB
WebGPU Nodes 519.35
142.4
532.28
145.92
+12.93 kB
+3.52 kB

@sunag
Copy link
Collaborator

sunag commented Jan 17, 2025

We must apply some array-camera related changes to get that bit right.

Awesome! You already know what the changes would be, I can help if necessary.

@sunag sunag added this to the r173 milestone Jan 17, 2025
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 17, 2025

Not yet, tbh^^. I did a quick test with a Pixel 8a when webgpu_xr_cubes worked on a Quest 2.

@Mugen87 Mugen87 merged commit e6a79f8 into mrdoob:dev Jan 17, 2025
12 checks passed
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 17, 2025

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 17, 2025

On a Pixel 8a and Chrome I get the following runtime errors:

three.webgpu.js:9851 Uncaught TypeError: Cannot read properties of null (reading 'charAt')
at UniformArrayNode.getPaddedType (three.webgpu.js:9851:27)
at new UniformArrayNode (three.webgpu.js:9786:26)
at uniformArray (three.webgpu.js:10021:58)
at three.webgpu.js:10080:36
at Proxy.call (three.webgpu.js:3081:104)
at Proxy.setupOutput (three.webgpu.js:3121:35)
at Proxy.getOutputNode (three.webgpu.js:3103:33)
at Proxy.setup (three.webgpu.js:3113:15)
at Proxy.build (three.webgpu.js:1628:29)
at Proxy.build (three.webgpu.js:1642:17)

as well as

three.webgpu.js:57290 THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false
Program Info Log: invalid shaders�
0:16: L0001: Interpolation qualifiers can be used only for fragment inputs or vertex outputs, found for 'webgl_fd9dbd8b76f9ae82'�

On a Quest 2, the browser console is free from errors.

@sunag
Copy link
Collaborator

sunag commented Jan 17, 2025

One thing I remember that hasn't been added support yet is dynamically changing the length of the cameras array in ArrayCamera.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 17, 2025

Um, that could be the issue. The count of the array camera's sub cameras seems to vary in the Phone AR case.

@sunag
Copy link
Collaborator

sunag commented Jan 17, 2025

Hmm.. I'll add that support then.

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