Skip to content

Conversation

@techcodie
Copy link

The Issue #32268

  • Video textures in WebXR appear 90 degrees to the right of center in projection layers
  • Affects mono/stereo video textures, requiring manual transforms to center them
  • Longstanding problem affecting WebXR applications

The Solution

  • Applies -90° Y-axis rotation to XR camera to correct video texture orientation
  • Configurable via videoTextureCorrection flag (default: false, opt-in)
  • Works for both WebGL and WebGPU renderers
  • Zero performance overhead - simple quaternion multiplication

How It Fixes the Issue

  • Users enable correction when needed: renderer.xr.videoTextureCorrection = true
  • Video textures are centered in WebXR sessions when enabled
  • Note: This rotates the entire camera, affecting all rendered content

Files Changed

  • src/renderers/webxr/WebXRManager.js
  • src/renderers/common/XRManager.js

Add videoTextureCorrection flag to apply -90° Y-axis rotation correction
for video textures in WebXR projection layers.

- Add videoTextureCorrection flag (default: false, opt-in) to WebXRManager
- Add videoTextureCorrection flag (default: false, opt-in) to XRManager
- Apply -90° Y-axis rotation correction when flag is enabled
- Works for both WebGL and WebGPU renderers
- Zero performance overhead - simple quaternion multiplication

Usage: renderer.xr.videoTextureCorrection = true;

Note: This rotates the entire camera, affecting all rendered content.
@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 356.28
86.49
356.5
86.56
+219 B
+71 B
WebGPU 616.52
173.1
616.72
173.17
+195 B
+63 B
WebGPU Nodes 615.13
172.85
615.32
172.92
+195 B
+64 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 488.15
121.31
488.35
121.37
+197 B
+56 B
WebGPU 688.76
189.02
688.95
189.08
+196 B
+60 B
WebGPU Nodes 630.48
172.25
630.67
172.3
+196 B
+58 B

@mrdoob
Copy link
Owner

mrdoob commented Nov 19, 2025

Can you share a screenshot of the issue?

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