Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotate eyes properly for direct mode #58

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ChristophHaag
Copy link
Owner

With this, SteamVR should be able to use direct mode.

The actual rotation isn't well tested though, please someone test.

Possible issues:

  • Left/right eye switched
  • Eyes rotated in the wrong direction (upside down)

@ghost
Copy link

ghost commented Mar 11, 2021

EDITED: WVR2 eye transforms are fixed now. Folks please test with whatever headset(s) you have.

@ChristophHaag
Copy link
Owner Author

So if I remember correctly only the LG 360 actually has the hack with the rotated projection matrix. This PR extracts the display rotation from that rotated projection matrix. There is also an example for the WVR2 that sets the rotation directly.

More rotations that could be hardcoded can be found in monado https://gitlab.freedesktop.org/monado/monado/-/blob/master/src/xrt/drivers/ohmd/oh_device.c#L307

One thing that should be improved is to clarify whether left rotation means the display is physically built into the HMD rotated to the left and the software should render everything rotated to the right to compensate; or whether left rotation means that we just want to rotate the rendering to the left.

@ghost
Copy link

ghost commented Mar 27, 2021

A reminder that the DK2 has the same quirk as WVR2. How do we want to deal with the list of quirks? OpenHMD sits at the driver layer, but SteamVR-OpenHMD is on the same level as Monado, so the quirk-handling responsibility is on this project.

One thing that should be improved is to clarify whether left rotation means the display is physically built into the HMD rotated to the left and the software should render everything rotated to the right to compensate; or whether left rotation means that we just want to rotate the rendering to the left.

I think that encapsulates the difficulty many people have with 3D math, or math in general.

@TomateSoft
Copy link

TomateSoft commented Oct 22, 2021

Hi Christoph, I'm currently testing using a Rift S under Linux with AMD GPU. In order to get Driver Direct Mode working I had to force a rotation of both eye to the left (using your code at #68, rotating right made it upside down).

I might have gotten it wrong the first time
* creation of the projection matrix was obviously wrong
* debug printing of the matrices was wrong

Now it should be right, but the rotated projection matrix for rift s can not work
because m[0][0] is 0.
@ReazerDev
Copy link

ReazerDev commented May 14, 2022

Hi, using this branch, I don't get any image on my Rift S. The display does turn on (I see a slightly gray image and not a completely black one). However, xrandr shows the display as disconnected. Setting non-desktop to 0 doesn't change anything, it doesn't even show up in my Settings.
Using the master branch, the SteamVR Window is shown on one of my Monitors, xrandr says it's connected and after setting non-desktop to 0, I can see the Rift S Display in my Settings.

Using the monado-steamvr plugin, I do get an Image on my VR Display, but everything is quite choppy.
So far, from what I can see on my monitor, this plugin is smooth, when turning my head.

(I am wearing my Headset in both cases)

@thaytan
Copy link
Collaborator

thaytan commented May 15, 2022

Hi, using this branch, I don't get any image on my Rift S.

I'm in the process of porting the Rift S driver to Monado. You might like to try my branch. I haven't tested SteamVR, but I think it should work. OpenXR apps render correctly.

https://gitlab.freedesktop.org/thaytan/monado/-/commits/dev-rift-s

@ReazerDev
Copy link

Hi, I created an Issue in your GitLab repo, so we don't spam this PR :)

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.

4 participants