Skip to content

fix(steamvr): render with the headset's own fields of view and IPD - #9

Merged
aaf2tbz merged 1 commit into
metalsharp:mainfrom
multision:fix/steamvr-headset-views
Nov 18, 2026
Merged

aaf2tbz merged 1 commit into
metalsharp:mainfrom
multision:fix/steamvr-headset-views

Conversation

@multision

Copy link
Copy Markdown
Contributor

Summary

With a Quest 3 the two eyes did not fuse: each eye showed the picture, but the view looked doubled.

The driver read the fields of view and eye distance once, from HELLO. A headset streamed over ALVR reports its own only once it connects (AlvrDriver::onViews), usually after SteamVR has started, so SteamVR kept rendering with the model's defaults from daemon/headsets.cpp: for a Quest 3 a symmetric 55° each side and 48° up and down. The headset's eyes are asymmetric; this one reported -54/+40° (left eye), -40/+54° (right eye), 44° up, 55° down, IPD 64.1 mm. metalvrd composes the eyes into the stream as drawn, without reprojecting them to another projection, and the headset displays each with its real one, so each eye's image sat shifted and the two could not be fused.

metalvrd already returns the headset's views with every tracking sample (views[eye].fov and the eye poses). When they change, the driver now updates its copy (which Display::GetProjectionRaw and the layers' eye poses read) and tells SteamVR, as ALVR's driver does in Hmd::SetViewsConfig: SetDisplayEyeToHead, SetDisplayProjectionRaw (in GetProjectionRaw's convention, top being the tangent below the axis, which ALVR's fov_to_projection uses too), Prop_UserIpdMeters and VREvent_IpdChanged. It logs the views once each time they change.

A possible follow-up: the views could reach the driver as an explicit message from metalvrd rather than being compared on every tracking sample. That would be a protocol change, so I have left it here as a suggestion.

Testing

  • Built for macOS and for Windows (build/native, build/win64): not run, no CMake or Ninja on this Mac. steamvr/driver_metalvr.dll was built with x86_64-w64-mingw32-g++ 16.2 from the CMake target's sources, include paths and flags (C++20, -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers, static runtime): 0 warnings, as on main. CI covers the full builds.

  • scripts/test-native.sh and scripts/test-failures.sh: not run. They do not reach the SteamVR driver, and tests/ has no harness for it yet, so this change has no automated check; happy to add one if there is a preferred shape for it.

  • scripts/test-wine.sh: not run.

  • scripts/test-openvr.sh: not run (this is the SteamVR driver, not the OpenComposite path).

  • On a headset: Meta Quest 3 over Wi-Fi with the ALVR client, metalvrd from the v0.2.1 release (ALVR server v20.14.1), SteamVR 2.18.4 on MetalSharp Wine 8.0 (Wine 11.17, x86_64 under Rosetta), Apple silicon Mac, macOS 27. Tried in SteamVR Home and Blade & Sorcery.

    Before: both eyes rendered at the default -55/+55°, 48/-48°, and the view looked doubled. After: the driver logged the headset's own views a moment after it connected (the values above), and the eyes fused into one stereo picture.

Checklist

  • The change is my own work, or open-source code whose license allows it here; nothing is taken from a closed-source product
  • Changes to ALVR or OpenComposite are patches under patches/, not edits in external/
  • New downloads are pinned to a commit
  • Documentation is updated where behaviour, options or the protocol change (no documented behaviour changes)
  • No Wine prefixes, logs with personal paths, or other personal data

The driver read the fields of view and eye distance once, from HELLO. A headset
streamed over ALVR reports its own only after it connects, usually later, so
SteamVR kept rendering with the model's defaults: for a Quest 3 a symmetric 55
degrees each side, where the headset's eyes are asymmetric (about -54/40 left,
-40/54 right, 44 up, 55 down). metalvrd sends the eyes on as drawn, and the
headset displays each with its real projection, so each eye's image sat
shifted and the two would not fuse: the view looked doubled.

metalvrd already returns the headset's views with every tracking sample. When
they change, update the driver's copy and tell SteamVR, as ALVR's driver does:
SetDisplayEyeToHead, SetDisplayProjectionRaw (in Display::GetProjectionRaw's
convention), Prop_UserIpdMeters and VREvent_IpdChanged.
@multision
multision requested a review from aaf2tbz as a code owner November 18, 2026 20:10
@aaf2tbz
aaf2tbz merged commit 31d3007 into metalsharp:main Nov 18, 2026
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