-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Driver Documentation
This is an overview of the steps to write a new OpenVR driver. In the examples, the driver is simply called "mydriver".
It is advisable to use the built-in SteamVR drivers as references. For example, the Oculus driver is maintained by Valve and demonstrates nearly all of the below features (excluding driver registration). The built-in drivers can be found in your Steam install directory in the sub-path 'Steam\steamapps\common\SteamVR\drivers'.
- Put all the files for your driver under a directory. Let's say that directory is "/mydriver"
- Add a new DLL to "mydriver/bin/win64/driver_mydriver.dll" (For Linux use the appropriate platform directory and the appropriate shared library extension.)
- Implement the driver factory function in that DLL.
-
Add an implementation ofThis was removed in OpenVR version 1.0.6.vr::IClientTrackedDeviceProvider
to the DLL and return it from the factory. This provider will be phased out in the next SDK udpate, but for now you need it. - Add an implementation of
vr::IServerTrackedDeviceProvider
and have that return implementations ofvr::ITrackedDeviceServerDriver
for each tracked device. - Add a driver manifest file to "/mydriver"
- Add and remove your driver to SteamVR's config file using vrpathreg.
- If you are deploying your driver through Steam and do not have an executable to put in your Steam launch options, you can use a Steam URL to launch SteamVR. This way, if a user launches your driver through Steam, it will automatically start SteamVR. The launch option is:
steam://run/250820
For devices with buttons, triggers, joysticks, and other kinds of input controls, please refer to the vr::IVRDriverInput
API. Reference the Input Profiles
page for information on icons, images, and localization.
For devices that wish to provide animation data through the Skeletal Input system, please refer to the Skeletal Input Driver documentation.
The source code for a sample driver is available here. The sample implements these interfaces and includes an example HMD/controller.
Other driver documentation: