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

WebGLRenderer: Fix WebXR depth sensing. #28530

Merged
merged 2 commits into from
May 30, 2024
Merged

Conversation

cabanier
Copy link
Contributor

Depth sensing is broken in the current version of three.js.
This change will restore depth sorting functionality and also removes the extra renderpass of the previous solution.

The samples also didn't add the depthSensing dictionary during session creation. Quest browser wasn't spec compliant so didn't pass this in. That will be fixed in a future version of the spec.

cc @Mugen87

Copy link

github-actions bot commented May 30, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
677.8 kB (168 kB) 677.9 kB (168.1 kB) +147 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
455.8 kB (110.1 kB) 456 kB (110.1 kB) +147 B

@Mugen87 Mugen87 changed the title webxr depth sensing fixes WebGLRenderer: Fix WebXR depth sensing. May 30, 2024
@Mugen87 Mugen87 added this to the r165 milestone May 30, 2024
@Mugen87 Mugen87 merged commit e388fc4 into mrdoob:dev May 30, 2024
12 checks passed
@cabanier cabanier deleted the depth_options branch May 30, 2024 19:59
document.body.appendChild( XRButton.createButton( renderer, { 'optionalFeatures': [ 'depth-sensing'] } ) );
document.body.appendChild( XRButton.createButton( renderer, {
'optionalFeatures': [ 'depth-sensing' ],
'depthSensing': { 'usagePreference': [ 'gpu-optimized' ], 'dataFormatPreference': [] }
Copy link
Owner

Choose a reason for hiding this comment

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

Is 'dataFormatPreference': [] needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is. We're updating the spec to specify that an empty array means that the value is optional.

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