lvra.gitlab.io/content/docs/fossvr/opencomposite/_index.md

4 KiB

weight title
800 OpenComposite

OpenComposite

OpenComposite OpenXR (previously known as OpenOVR - OpenVR for OculusVR - but renamed due to confusion with OpenVR) is an implementation of SteamVR's API - OpenVR, forwarding calls directly to the OpenXR runtime. Think of it as a backwards version of ReVive, for the OpenXR compatible headsets.

This allows you to play SteamVR-based games on an OpenXR compatible headset as though they were native titles, without the use of SteamVR!

Please note the OpenVR implementation is incomplete and contains only what's necessary to run most games for compatibility. If you plan to implement software, utilize the OpenXR API, specification here.

OpenComposite is required for Steam Play games to work in VR regardless of API. Due to the number of confounding factors surrounding setup, sandboxing, and more quirks; we recommend you use Envision to setup and manage your VR.

Contributions to improve the OpenVR to OpenXR mapping are welcome.

Forcing additional devices as trackers

OpenComposite has the environment variable OPENCOMPOSITE_TRACKER_SERIALS to allow using non-tracker devices as trackers in SteamVR games. The expected format is as follows: serial1;serial2 where each 'serial' is a device serial like LHR-00000000 or WiVRn HMD. You can set this on games by setting this launch option in Steam: env OPENCOMPOSITE_TRACKER_SERIALS="LHR-00000001;LHR-00000002" %command%.

To obtain info for lighthouse devices, you may look at the top of the Monado stdout when using steamvr_lh. For other types of devices there are multiple ways of obtaining device serials:

  • OpenComposite log file

    The OpenComposite log file at ~/.local/state/OpenComposite/logs/opencomposite.log will log all seen devices when checking for trackers, so you can search for Checking for generic trackers... in the log file and look below for Found usable xdev.

  • motoc

    motoc has the show subcommand for viewing all device names, serials, and positions relative to the space origin.

Rebinding controls

Changing OpenVR bindings is currently a very manual process. This will change in the future.

We're going to be using VRChat as an example, but this should apply to just about any OpenVR game.

First, we locate where the bindings are stored. For Unity games this is always in GameName_Data/StreamingAssets/SteamVR.

In the case of VRChat, it would be in PATH_TO_STEAM/steamapps/common/VRChat/VRChat_Data/StreamingAssets/SteamVR/

Create a folder next to the game's executable called OpenComposite. Make a copy of the bindings file for your controller and place it in the OpenComposite folder. Open it up and look for controller_type, it's typically near the bottom of the file.

"controller_type" : "knuckles",

Rename the copy you've made to the value of controller_type.

In my case i've ended up with a copy of the valve index bindings named knuckles.json located in PATH_TO_STEAM/steamapps/common/VRChat/OpenComposite/knuckles.json.

Going back to the location of the original bindings, open up actions.json, which defines every possible action in the game. A popular binding is changing the microphone button to toggle gestures. We'll use this as an example.

in actions.json, we can find the name of the desired actions.

"/actions/Global/in/Mic": "Toggle Microphone", //the one we want to replace
"/actions/Global/in/Gesture_Toggle": "Gesture Toggle", //the one we want to replace it with

in our copy knuckles.json, we can then look for actions/Global/in/Mic and replace it with Gesture_Toggle like this:

{
    "inputs" : {
        "click" : {
           "output" : "/actions/global/in/Gesture_Toggle"
        }
    },
    "mode" : "button",
    "path" : "/user/hand/left/input/a"
},

And that's it! OpenComposite will automatically pick up these files as long as they're placed and named correctly, and load them instead of the game's provided ones.