Repository navigation
fix(steamvr): render with the headset's own fields of view and IPD - #9
Merged
Merged
Conversation
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.
6 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromdaemon/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.metalvrdcomposes 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.metalvrdalready returns the headset's views with every tracking sample (views[eye].fovand the eye poses). When they change, the driver now updates its copy (whichDisplay::GetProjectionRawand the layers' eye poses read) and tells SteamVR, as ALVR's driver does inHmd::SetViewsConfig:SetDisplayEyeToHead,SetDisplayProjectionRaw(inGetProjectionRaw's convention, top being the tangent below the axis, which ALVR'sfov_to_projectionuses too),Prop_UserIpdMetersandVREvent_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
metalvrdrather 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.dllwas built withx86_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 onmain. CI covers the full builds.scripts/test-native.shandscripts/test-failures.sh: not run. They do not reach the SteamVR driver, andtests/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
patches/, not edits inexternal/