Skip to content

Fix stereo and 180 degree video rendering, add 360 stereo side-by-side - #2038

Open
NataleVIL wants to merge 3 commits into
Igalia:mainfrom
vil-it:upstream-video-fixes
Open

Fix stereo and 180 degree video rendering, add 360 stereo side-by-side#2038
NataleVIL wants to merge 3 commits into
Igalia:mainfrom
vil-it:upstream-video-fixes

Conversation

@NataleVIL

@NataleVIL NataleVIL commented Aug 6, 2026

Copy link
Copy Markdown

With the move from OculusVR to OpenXR several VR video formats stopped working and were fixed one format at a time — 3D side-by-side in 6f5793b, Stereo 180 Left to Right in 01cca10 (Fixes #562). The remaining equirect projections were never revisited and still carry both of the defects #562 described. Three independent commits, each builds on its own.

Both eyes get the same half of the frame — #562: "flat (no depth) with same image in each eye". VRLayer defaults useSameLayerForBothEyes to true, so GetNumXRLayers() submits a single equirect layer with XR_EYE_VISIBILITY_BOTH and applies only the left eye's UV transform. create180LRProjectionLayer() got the fix in 01cca10; create360StereoProjectionLayer() and create180TBProjectionLayer() did not. The default is now documented where it is declared, since nothing marked that call as load-bearing.

The 180 degree hemisphere is not centred — #562: "stretched to a dome almost to the extent when there should be black there". A horizontal UV scale of 2 maps the texture onto half the sphere, so without the matching -0.5 bias that half sits 90 degrees off to the side and looking forward shows the edge of the image. Also fixed for left-to-right only in 01cca10; create180ProjectionLayer() and create180TBProjectionLayer() were left out.

Adds VIDEO_PROJECTION_360_STEREO_LEFT_RIGHT. Full-sphere stereo existed only as over/under. Adds mesh and compositor-layer implementations, a menu entry and mozVideoProjection=360lr, plus 360tb as an alias for 360s. Neither the "360 Stereo" label nor its icon said that it means over/under, so both 360 modes now follow the naming and divider-bar icon conventions of the 180 modes: 360 Stereo → Stereo 360 Top to Bottom, new → Stereo 360 Left to Right. The string key is kept so existing translations are not orphaned; de and en-rGB are updated. Happy to use a new key, or hand the icons to someone with a better eye, if you prefer.

Tested on a Pico Neo 3 (OpenXR, Gecko) with generated equirect videos where one half is red and the other blue. Before, all three stereo modes showed red in both eyes; now the left eye shows red and the right blue, and 180 top/bottom is centred. Can post the ffmpeg and adb commands if useful.

VRLayer defaults useSameLayerForBothEyes to true. When it is set,
OpenXRLayerBase::GetNumXRLayers() returns 1, so a single equirect layer
is submitted with XR_EYE_VISIBILITY_BOTH and only the left eye's UV
transform is applied. Both eyes then receive the same half of the frame
and stereo video plays back mono.

create180LRProjectionLayer already disabled the flag, but
create360StereoProjectionLayer and create180TBProjectionLayer did not.
The default is now documented where it is declared, since the path that
got it right said nothing about it.

Verified on a Pico Neo 3 (OpenXR) with an equirect test video whose top
half is red and bottom half blue: before this change both eyes showed
red, afterwards the left eye shows red and the right eye blue.
The 180 degree paths use a horizontal UV scale of 2 so the texture maps
onto half the sphere. Without a matching -0.5 horizontal bias that half
ends up 90 degrees off to the side: looking straight ahead shows the
edge of the image, with black filling the rest of the view.

create180LRProjectionLayer already applied the bias;
create180ProjectionLayer and create180TBProjectionLayer did not.

Verified on a Pico Neo 3 (OpenXR): the hemisphere is now centred on the
forward direction instead of starting at the centre of the view.
Full-sphere stereo was only available as over/under. Side-by-side
existed for 180 degree and flat 3D video, but not for 360, so
side-by-side 360 content could not be viewed in stereo at all.

Adds VIDEO_PROJECTION_360_STEREO_LEFT_RIGHT with both a mesh and a
compositor-layer implementation, a menu entry with icon, and the
mozVideoProjection=360lr query parameter. 360tb is accepted as an alias
for 360s so the query-string vocabulary matches 180tb/180lr/3dtb; 360s
keeps working. The specific values are matched before the bare 360
prefix, as already needed for 180lr and 180tb.

Neither the "360 Stereo" label nor its icon said that it means
over/under, which makes diagnosing content format problems harder than
it needs to be. Both 360 modes now follow the naming scheme and the
divider-bar icon convention already used by the 180 modes:

  360 Stereo -> Stereo 360 Top to Bottom
  (new)      -> Stereo 360 Left to Right

Translations are updated for de and en-rGB only; the remaining locales
fall back to English until they are handled by the l10n process. The
string key is kept so existing translations are not orphaned.

Verified on a Pico Neo 3 (OpenXR) with an equirect test video whose left
half is red and right half blue: the left eye shows red, the right blue.
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.

Stereo 180 Left to Right projection broken

1 participant