• Stars
    star
    298
  • Rank 134,453 (Top 3 %)
  • Language
    C#
  • License
    BSD 3-Clause "New...
  • Created almost 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenVR plugin for Unity's XR API

OpenVR Unity XR Plugin

The purpose of this package is to provide OpenVR rendering to Unity XR. This package provides the necessary sdk libraries for users to build Applications that work with the OpenVR runtime. The OpenVR XR Plugin gives you access to rendering on all major VR devices through one interface. Explicit support for: HTC Vive, HTC Vive Cosmos, Oculus Rift, Oculus Rift S, Oculus Quest (Link), Windows Mixed Reality, and Valve Index. Other SteamVR compatible devices are supported though may have inaccurate or incomplete features. See our QuickStart guide.

License

This project is under the BSD 3 Clause license (/LICENSE) except the unity headers in the CommonHeaders/ProviderInterface folder, where you'll find the Unity Companion License (/CommonHeaders/ProviderInterface/LICENSE.md)

Documentation

There is some brief documentation included with this plugin at /Documentation~/com.valvesoftware.unity.openvr.md

Input

As part of our commitment to OpenXR we will begin targeting the OpenXR API in future versions of our game engine plugins.

For now, to get access to controllers and other forms of input you will need to install the beta version of the SteamVR Unity Plugin. This can be found at (https://github.com/ValveSoftware/steamvr_unity_plugin/releases/tag/2.6.0b4).

Known Issues:

  • Display Provider
    • OpenVR Mirror View Mode can cause black screens in the game view. Please send us bug reports if this happens.
    • OpenVR Mirror View Mode requires use of Linear Color Space (Project Settings > Player > Other Settings > (Rendering) Color Space)
    • In certain use cases, changing RenderScale and ViewPortScale in runtime causes some performance spikes

Bug reports:

  • For bug reports please create an issue on our github (https://github.com/ValveSoftware/unity-xr-plugin/issues) and include the following information
    • Detailed steps of what you were doing at the time
    • Your editor or build log (editor log location: %LOCALAPPDATA%\Unity\Editor\Editor.log)
    • A SteamVR System report DIRECTLY AFTER encountering the issue. (SteamVR interface -> Menu -> Create System Report -> Save to file)

Structure

Unity Package

There is a C# project in /com.valve.openvr which is the unity package that does the high level loading and configuration for the plugin. It also manages OpenVR Events. We've included pre-built DLLs in this package for ease of access.

Native Plugin

The brains of the plugin are in a native dll at com.valve.openvr/Runtime/x64/XRSDKOpenVR.dll. The source for this dll is in the rest of this project, but mainly in the /Providers directory.

NPM Installer

For developers not building this package from source we have a separate Installer package which adds a scoped registry to your project's package manifest and then installs the OpenVR Unity XR Plugin from npm. This also lets you easily upgrade the plugin within the unity package manager. The code for this installer lives in the Installer branch.

Building from source

  1. Clone this GitHub repo to your local machine

  2. Open a Powershell window in the root directory of your cloned repo

  3. Run CMake to generate appropriate build files, such as:

    cmake -G "Visual Studio 16 2019" .

    cmake -G "Visual Studio 16 2019" -A Win32 .

    cmake -G "Visual Studio 15 2017 Win64" .

  4. (Optional) Compile the runtime using CMake. Make sure you have MS Visual Studio 2017 or 2019 with C++ support installed:

    cmake --build . --target ALL_BUILD --config Debug

    cmake --build . --target ALL_BUILD --config Release

QuickStart

Installation

  • Download the installer: https://github.com/ValveSoftware/unity-xr-plugin/releases/tag/installer
  • Open your unity project and then open/import the unitypackage
  • Open the XR Management UI (Edit Menu -> Project Settings -> XR Plugin Management)
  • Click the checkbox next to OpenVR Loader - or in older versions - Under Plugin Providers hit the + icon and add “Open VR Loader”

Standalone (no input)

  • Add a cube to the scene (scale to 0.1)
  • Add a Camera component to the cube
  • Add TrackedPoseDriver to the cube
  • Main Camera: Under Tracked Pose Driver:
    • For Device select: “Generic XR Device”
    • For Pose Source select: “Center Eye - HMD Reference”
  • Hit play and you should see a tracked camera

SteamVR Input System:

  • Install SteamVR Unity Plugin v2.6.1+ (https://github.com/ValveSoftware/steamvr_unity_plugin/releases/)
  • It should install the OpenVR XR API package automatically for 2020.1+ for 2019.3/4 you’ll need to add it with the instructions above.
  • Open the SteamVR Input window (Window -> SteamVR Input)
  • Accept the default json
  • Click Save and Generate
  • Open the Interactions_Example scene (Assets/SteamVR/InteractionSystem/Samples/Interaction_Example.unity)
  • Hit play, verify that you can see your hands and teleport around

Package installation from source

  • Open the Unity Package Manager (Window Menu -> Package Manager)
  • Click the plus in the upper lefthand corner and select "Add package from disk..."
  • Select the package.json in the com.valve.openvr directory
  • Open the XR Management UI (Edit Menu -> Project Settings -> XR Plugin Management)
  • Click the checkbox next to OpenVR Loader - or in older versions - under Plugin Providers hit the + icon and add “Open VR Loader”

More Repositories

1

Proton

Compatibility tool for Steam Play based on Wine and additional components
C++
22,477
star
2

GameNetworkingSockets

Reliable & unreliable messages over UDP. Robust message fragmentation & reassembly. P2P networking / NAT traversal. Encryption.
C++
7,681
star
3

openvr

OpenVR SDK
C++
5,946
star
4

steam-for-linux

Issue tracking for the Steam for Linux beta client
4,034
star
5

source-sdk-2013

The 2013 edition of the Source SDK
C++
3,591
star
6

halflife

Half-Life 1 engine based games
C++
2,971
star
7

steam-audio

Steam Audio
C++
2,055
star
8

ToGL

Direct3D to OpenGL abstraction layer
C++
2,009
star
9

SteamOS

SteamOS community tracker
1,465
star
10

vogl

OpenGL capture / playback debugger.
C++
1,415
star
11

Dota2-Gameplay

Public Bug Tracker for Dota2
1,388
star
12

steam-runtime

A runtime environment for Steam applications
Shell
1,133
star
13

wine

Wine with a bit of extra spice
C
1,093
star
14

steamvr_unity_plugin

SteamVR Unity Plugin - Documentation at: https://valvesoftware.github.io/steamvr_unity_plugin/
C#
1,010
star
15

SteamVR-for-Linux

Issue tracker for the Linux port of SteamVR
901
star
16

csgo-osx-linux

Counter-Strike: Global Offensive
750
star
17

Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
572
star
18

Fossilize

A serialization format for various persistent Vulkan object types.
C++
510
star
19

IndexHardware

474
star
20

csgo-demoinfo

CS:GO demo parsing tool
C++
472
star
21

Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
454
star
22

steamlink-sdk

450
star
23

counter-strike

CS:GO
JavaScript
430
star
24

steamos_kernel

SteamOS kernel branches
C
388
star
25

dxvk

dxvk tree containing branches used by Proton
C++
342
star
26

ArtifactDeckCode

Reference code and documentation for Artifact deck codes
PHP
276
star
27

the_lab_renderer

Valve’s VR renderer used in The Lab (Valve’s VR launch title for the HTC Vive).
C#
272
star
28

voglperf

Benchmarking tool for Linux OpenGL games. Spews frame information, logs frametimes.
C
198
star
29

steamvr_unreal_plugin

SteamVR Input Unreal Plugin - Documentation at: https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki Sample project (UE4.15-4.23): https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki/sample/SteamVRInputPlugin.zip Sample Project (UE.424+): https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki/sample/SteamVRInputPlugin_UEIntegrated.7z
C++
164
star
30

steamos_mesa

Patched branches of Mesa used in SteamOS
C
157
star
31

Moondust

C#
155
star
32

portal2

Issues for the Linux port of Portal 2
136
star
33

steamworks-vr-api

Source for the Steamworks VR API
136
star
34

steam-devices

List of devices Steam and SteamVR will want read/write permissions on, to help downstream distributions create udev rules/etc
128
star
35

vkd3d

C
120
star
36

steamos-compositor

SteamOS session compositing window manager
C
109
star
37

driver_hydra

OpenVR Driver for Razer Hydra using Sixense SDK
C++
99
star
38

Dota-2-Vulkan

Tracker for issues specific to the Vulkan version of Dota 2 on Windows, Linux, and macOS
93
star
39

virtual_display

An example OpenVR driver for demonstrating the IVRVirtualDisplay interface.
C++
80
star
40

openxr_engine_plugins

Contains Valve-provided plugins for using OpenXR extensions with various game engines
Mathematica
46
star
41

linux

SteamOS fork of the Debian kernel packaging repository at https://anonscm.debian.org/git/kernel/linux.git/
45
star
42

eigen

Fork of Eigen release version 3.4. Adds ability to use alternate threading systems from Open MP.
C++
22
star
43

Dota-Underlords

Tracker for issues specific to the Linux and macOS client of Dota Underlords
22
star
44

OpenXR-Canonical-Pose-Tool

A tool to help OpenXR runtime developers match their poses to other runtimes' poses.
C
10
star
45

VR-Community-Bugs

Repository for VR Bugs reported through tickets and community outreach
9
star