If you’re embarking on AR/VR projects and need extensive platform compatibility, use OpenXR. However, if focusing on gaming applications is your priority via a proprietary API, opt for OpenVR.

OpenXR and OpenVR compared

Key Differences Between OpenXR and OpenVR

  • OpenXR is an open standard, reducing development and maintenance burden, while OpenVR is a proprietary API developed by Valve.
  • OpenXR is backed by many tech giants and ensures cross-platform compatibility, while OpenVR primarily supports SteamVR games and software.
  • OpenVR was released earlier in 2015, with OpenXR entering the scene in 2019.
  • OpenXR has extensive extension support for advanced VR features, while OpenVR’s feature updates revolve around gaming application enhancements.
ComparisonOpenXROpenVR
Initial ReleaseJuly 29, 2019April 30, 2015
Key FeaturesUnifies AR/VR development, reduces need for porting or rewriting code, seamless integration with various platforms and devices.Supports SteamVR and other virtual reality headset devices, serves as interface between VR hardware and software, default SDK for HTC Vive.
API ElementsXrSpace, XrInstance, System & XrSystemId, XrActions, XrSession.IVRApplications_Version, IVRSystem_Version, IVRTrackedCamera_Version, IVRCompositor_Version, IVRDriverManager_Version, IVRSpatialAnchors_Version, IVRScreenshots_Version.
Maintenance and Extension SupportOpen-source maintained by Khronos Group consortium, receives steady updates, future plans for extended capabilities, extension support for world-scale experiences, spatial anchors, hand/eye tracking, scene understanding, composition layer & reprojection modes.OpenVR Class Reference includes constructors, fields, properties, methods, supports multiple tracked objects, models, and textures, support for numerous modes and settings.
Purpose and BenefitsDesigned to solve AR/VR fragmentation, ensures maximum performance and minimum latency, lowers the barrier for developers to utilize eye tracking, allows developers to focus more on creative vision, establishes a foundation for AR/VR ecosystem.Development of SteamVR games and software, plugin and native support for OpenVR SDK in Unity, allows for multi-vendor support.

What Is OpenXR and Who’s It For?

OpenXR is a royalty-free, open standard aimed at unifying the AR/VR software development for broader hardware reach. Launched by the Khronos Group consortium on July 29, 2019, OpenXR reduces the effort for porting or re-writing code. It merges VR/AR applications and engines under common APIs for seamless integration across diverse platforms and devices. Founded on core API elements like XrSpace, XrInstance, System & XrSystemId, XrActions, and XrSession, OpenXR is intended for all VR/AR developers, from hobbyists to industry veterans.

Colorful panoramic view of a developer immersed in AR/VR work, spanning from device compatibility checks to runtime adjustments

Pros of OpenXR

  • Unifies AR/VR software development
  • Cuts down need for porting or re-writing code
  • Diverse device compatibility
  • Supports innovative, next-gen graphic technologies
  • Establishes foundation for AR/VR ecosystem

Cons of OpenXR

  • Non-engine entity, only enables engine portability
  • More complex compared to proprietary systems
  • Requires understanding of API elements for full utilization
  • Limited native support from older game engines

What Is OpenVR and Who’s It For?

Developed by Valve, OpenVR is a software development kit (SDK) and application programming interface (API) intended to serve as interface between VR hardware and software. Born on April 30, 2015, OpenVR is the default SDK for HTC Vive and boasts of multi-vendor support. With applications spanning from VR gaming to immersive software development, OpenVR is designed for developers interested in creating rich, immersive experiences with SteamVR hardware.

Colorful depiction of a gamer captivated by the immersive experience provided by OpenVR, with an HTC Vive headset set against a backdrop of streaming code

Pros of OpenVR

  • Interface between VR hardware and software
  • Supports multiple vendors like HTC Vive, Oculus Rift
  • Constantly updated with new interfaces and features
  • Enhanced tracking prediction capabilities
  • Supports ecosystem of Unity game engine

Cons of OpenVR

  • Dependency on SteamVR hardware
  • Somewhat complex API structure
  • Limited stand-alone capabilities, reliant on other devices
  • Not as universally adaptable as OpenXR

OpenXR vs OpenVR: Pricing

Both technologies, OpenXR and OpenVR, provide their services free of cost. This stems from their foundation of being open-source and a commitment to promote diversified developer engagement.

OpenXR

OpenXR’s primary design is royalty-free, promoting an open standard for high-performance access to AR/VR technologies. Developed and maintained by the Khronos Group consortium, OpenXR aims to unify the AR/VR software development landscape, thereby reducing the need for porting or rewriting code for different hardware platforms. This open-source feature ensures the technology’s availability to a diverse range of developers, prompting creative and innovative applications.

OpenVR

OpenVR, like OpenXR, follows an open-source protocol, aimed at forming a bridge between VR hardware and software applications. Developed by Valve Corporation, OpenVR’s accessibility is reflected in its use as the default SDK for the HTC Vive and its multi-vendor support. As a public open-source VR project, it’s accessible for developers seeking to manifest and distribute their creative applications.

Code Examples for OpenXR & OpenVR

OpenXR: Interactive Objects in AR

This JavaScript OpenXR code snippet sets up basic interaction with AR objects. It creates a sphere and initializes it as a touchable object. XRSession, XRReferenceSpace, and XRInputSource should preexist.

// Create a sphere and make it touchable
let sphere = new XRHitTestSource({ space: touchableSpace });

// Setup XR input sources
let inputSources = session.inputSources;

// Touch detection
for(let inputSource of inputSources) {
    if(inputSource.targetRayMode === 'gaze') {
        let hitTestResults = frame.getHitTestResults(sphere);
        if(hitTestResults.length > 0) {
            // Code to interact with the sphere
        }
    }
}

OpenVR: VR Teleportation

This OpenVR code demonstrates teleportation. By pressing the controller’s trackpad, the VR user can warp to distant spots. Prerequisites include OpenVR API, an initialized IVRSystem object, and IVRChaperone.

// Press trackpad to warp
if (vr_sys->GetControllerState(k_unControllerDeviceIndex_Hmd, &state, sizeof(state))) {
    if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_SteamVR_Touchpad)) {
        // Get headset's postion
        VRControllerState_t state;
        vr::HmdVector3_t position = GetPosition(state.rmat4x4Pose);
        // Teleport the user
        chaperone->ResetBounds(vr::ChaperoneCalibrationState_OK);
        chaperone->SetPlayAreaSize(position.v, position.v);
    }
}

OpenXR Versus OpenVR: Deciding the Superior AR/VR Technology

Both OpenXR and OpenVR are celebrated technology leaders with unique benefits. Yet, a verdict must be drawn. Let’s delve into this technology battleground and find your winner.

Developers Seeking Extensive Hardware Compatibility and Open Standards

Choose OpenXR. Its core strength lies in its mission to eradicate AR/VR fragmentation. An open source product maintained by the influential Khronos Group, it supports creative expression across diverse devices. Its steady updates and ambitious future plans ensure reliability and prospective growth. Notable public favor from tech giants such as Microsoft, Google and Nvidia vouches for its wide applicability.

Focused developer working on AR/VR project with multiple hardware devices and OpenXR

Application Engineers Targeting Exciting Interactive VR experiences

Again, the sturdy OpenXR steals this category. It’s designed for supreme performance with minimum latency and maximum device compatibility. For those targeting larger VR application development, OpenXR initiates the immersive FLIGHT engine support, world-scale experiences with focus area extension support, and versatile interoperability.

Enthusiastic application engineer amidst a brainstorming session

Game Makers Collaborating With Valve & SteamVR

For teaming with Valve and making iterative advancements in gaming, OpenVR stands unbeatable. Equipped with a rich set of features such as data tracking, VR system initialization, and textured object support, it serves as a perfect ally.

Game designer working on advanced gaming project with OpenVR

Our verdict: For vast hardware reach, OpenXR is the ideal choice. Should your project revolve around Valve or SteamVR, OpenVR’s unique capabilities shine. Ultimately, both platforms serve particular needs but OpenXR’s wider reach and flexibility make it a formidable contender in many use-case scenarios.