Skip to content

Add optional force monoscopic rendering mode to WebXRManager #33177

@AmrKhamis1

Description

@AmrKhamis1

Description

Currently, Three.js WebXR always renders stereo views for VR devices. In some cases, like panoramic or Matterport-style virtual 3d panorama projected tour that is require precise one camera position, having two slightly offset eyes causes the projection to appear misaligned (specifically Right eye)... especially when content is authored for a single viewpoint.

Solution

adding an optional monoscopic mode, controlled by a boolean flag:

renderer.xr.forceMonoscopic = true;

When enabled.. the right eye's position is overridden to match the left eye in WebXRManager.js:

if ( scope.forceMonoscopic && i === 1 && cameras[ 0 ] !== undefined ) {
    camera.position.copy( cameras[ 0 ].position );
    camera.matrix.compose( camera.position, camera.quaternion, camera.scale );
}

This allows both eyes to share the same view, without changing the stereo rendering by default.

Benefits

Fixes offset issues in single-view VR content.
Optional, default behavior remains stereo.
Negligible performance impact, almost none.

Note: I have already implemented a working local version of this feature, and it has been tested in production. I would like to submit it as a Pull Request if the maintainers agree.

Alternatives

no alternative solutions were found. WebXR does not provide a built-in way to force monoscopic rendering on stereo VR devices.

Additional context

A small comparison image is included below showing the difference between the previous behavior and my implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions