openvr
openvr copied to clipboard
Any guides for developing direct mode for DIY steamvr HMD driver?
Hi guys, I wrote a DIY steamvr HMD driver, but it can only work in extend mode, now I want to make it work in direct mode both on Nvida cards and AMD cards, I have searched lots of materials, but got no instructions about how to enable direct mode for a DIY steamvr HMD driver, does anyone can give me a clue? Thanks very much!
This is a very complex driver to write, as this interface is positioned much higher up in the rendering chain in OpenVR. Effectively, the VR app will use your driver to allocate textures (so there's a texture management component), and then give these textures back to you in layers, which you'll need to scale and compose (so there's also a compositor component), you'll then need to do lens distortion correction before your driver composes the 'final' image and somehow gets it to the headset.
The key here is understanding that there is an unfortunate naming convention going on. "Direct mode" as you mean it, and as it is meant by "VR-Direct" is a way of hiding an HDMI monitor from Windows (it otherwise is the same as "Extended mode", it's just freeing up any software using it from trying to figure out its co-ordinates in the Windows desktop system). The "Direct Mode interface" which the IVRDriverDirectModeComponent represents is a way of talking to Oculus HMDs in OpenVR without bypassing Oculus' own compositor. Effectively it's a way of using an existing VR API (eg. Oculus) from within SteamVR. If you don't have an existing VR API (and I assume you don't), then you would effectively need to write your own mini-Oculus runtime as described in the first paragraph. "Direct Mode" and "Direct Mode interface" are fundamentally two separate concepts.
In order to use "Direct Mode" with your "Extended Mode" driver (perhaps to save yourself from trying to figure out and tell OpenVR your WindowX and WindowY coordinates), you'd need to "whitelist" the EDID from your HMD "monitor" with your graphics driver (if possible), and perhaps SteamVR as well.
@TheDeveloperGuy Hi, thanks for your explanation, according to your reply, I have two questions, hope I can get some instructions from you if it is possible.
- How to
"whitelist"
the EDID from my HMD "monitor" with my graphics driver (like Nvidia GTX1060)? Any official instructions? - Where is the "Direct Mode interface" on Nvidia or AMD Cards?
Appreciate your help :-)
- AFAIK you need to speak to the GPU manufacturer for this, or search around OpenVR and OSVR for hints.
- "Direct Mode interface", better described as "Oculus Direct interface" or IVRDriverDirectModeComponent is part of OpenVR, you can find it in the headers, but I don't think you need this.
Is this a streaming HMD (using a fake monitor) or an actual HDMI HMD? If the former, you may be able to fake the EDID from an existing whitelisted HMD (like Vive, Oculus or OSVR).
@TheDeveloperGuy Unfortunately, it is a HDMI HMD, and the "Direct Mode interface" is only for Oculus, I don't need it...
However, I know the basic information about it, thanks again ;-)
@TheDeveloperGuy You seem to know a lot about this subject and I can almost find no info at all, so I hope you don't mind my question. I'm just wondering how this works. I'm studying some Chinese headset at the moment. In the Steam compositor, upon graphics initialization, there's a call to 'VrOculusDirect' in the openvr_api.dll. The openvr_api in turn then calls "VR_GetGenericInterface" with "IVROculusDirect_001" as argument. I've found that once a headset's driver is using the nvapi (or amd's liquidvr api) then this specific call in the Steam compositor returns 0. But for this specific headset it returns a pointer, so that seems proof the HMD is using the Oculus Direct interface . I'm just wondering how that works, does this mean that the headset's driver is supplying a compositor that the Steam compositor links into ? I found that screenshots of the final distorted hmd's image can't be shot via the Steam compositor this way, which would make sense if the Steam compositor never receives this final image. Just hoping you can elaborate a bit, all this is so interesting and I just can't find much info (just google: IVROculusDirect for example) ...
I'm not sure what your question is, so I'm going for "does this mean that the headset's driver is supplying a compositor that the Steam compositor links into ?". The answer to that question would be yes for "IVRDriverDirectModeComponent" based drivers. We'll have to assume that the "IVROculusDirect_001" interface is an older version of this that is still supported in the current SteamVR.
@Armixy Whitelisting a screen for the Nvidia DirectMode feature is under NDA. A little silly to me as I wish I could share. You will need to apply for a "VRWorks for Headset Developers" at: https://developer.nvidia.com/vrworks
I found that screenshots of the final distorted hmd's image can't be shot via the Steam compositor this way, which would make sense if the Steam compositor never receives this final image.
Info for Nvidias Frame Capture Analysis Tool (FCAT) can be found at http://www.geforce.com/whats-new/guides/fcat-vr-download-and-how-to-guide which can be used to capture what actually gets rendered in hmd.
https://youtu.be/VipgmnfrBMc
Hmm I just tried FCAT but it seems it doesn't allow for shooting screenshots of the HMD image ?
Hi guys, I wrote a DIY steamvr HMD driver, but it can only work in extend mode, now I want to make it work in direct mode both on Nvida cards and AMD cards, I have searched lots of materials, but got no instructions about how to enable direct mode for a DIY steamvr HMD driver, does anyone can give me a clue? Thanks very much!
@jin-qin have you fix it?I have the same problem,I would like to talk to you more about my problem, please contact me through [email protected]