Skip to content

Renderer: Disallow render target resizing while in XR. #30738

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
Mar 15, 2025

Conversation

cabanier
Copy link
Contributor

When you bring up the browser in overlay while in WebXR on the Quest browser, the example page tries to do a resize.
This messes up the rendertarget because it doesn't expect that its backing can be resized.

I added code to disallow resizing while in XR mode.

This contribution is funded by Meta

@cabanier
Copy link
Contributor Author

Should setPixelRatio also be gated?

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.02
78.26
336.02
78.26
+0 B
+0 B
WebGPU 524.9
146.21
524.97
146.22
+66 B
+10 B
WebGPU Nodes 524.37
146.1
524.43
146.12
+66 B
+11 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.06
112.14
465.06
112.14
+0 B
+0 B
WebGPU 597.68
162.47
597.75
162.49
+66 B
+13 B
WebGPU Nodes 552.81
151.96
552.87
151.97
+66 B
+12 B

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 15, 2025

Should setPixelRatio also be gated?

I would say no since this method is usually called once when setting up the renderer. Besides, setting the pixel ratio automatically triggers setSize() so if the latter method is gated, everything should be fine.

@Mugen87 Mugen87 added this to the r175 milestone Mar 15, 2025
@Mugen87 Mugen87 merged commit 4abd407 into mrdoob:dev Mar 15, 2025
12 checks passed
@Mugen87 Mugen87 changed the title disallow render target resizing while in XR Renderer: Disallow render target resizing while in XR. Mar 15, 2025
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