Immersive Visualization / IQ-Station Wiki

This site hosts information on virtual reality systems that are geared toward scientific visualization, and as such often toward VR on Linux-based systems. Thus, pages here cover various software (and sometimes hardware) technologies that enable virtual reality operation on Linux.

The original IQ-station effort was to create low-cost (for the time) VR systems making use of 3DTV displays to produce CAVE/Fishtank-style VR displays. That effort pre-dated the rise of the consumer HMD VR systems, however, the realm of midrange-cost large-fishtank systems is still important, and has transitioned from 3DTV-based systems to short-throw projectors.

OpenXR

From IQ-Station Wiki
Revision as of 09:08, 1 March 2022 by WSherman (talk | contribs) (Corrected a mistake I made about XR_RUNTIME_JSON)
Jump to navigation Jump to search

OpenXR Library (for Linux)

OpenXR is an open-specification SDK for standardizing interfaces between XR(VR/AR/MR) applications and XR display and input devices such as HMDs (aka headsets), tablets & phones, and hopefully one-day, CAVE-style VR displays. The OpenXR standard is maintained by the Khronos Group

Package Dependencies

There was only one additional package that I needed to install to build OpenXR on an RHEL-based Linux distribution:

  • jsoncpp-devel

Note that at one point the CMake process suggested that xcb_icccm.h development header is required, along with warnings about Xxf86vm and Xrandr packages but in the end those turned out not to be required.

Building the OpenXR SDK

In order to include the OpenXR test applications, including HelloXR (hello_xr), the OpenXR-SDK-Source version should be obtained:

% git clone https://github.com/KhronosGroup/OpenXR-SDK-Source.git

I set the CMAKE_BUILD_TYPE to RelWithDebugInfo (though other options are fine too), and also set CMAKE_INSTALL_PREFIX to a separate directory where I will have OpenXR installed. (I use the "Module" system, so I do not put installations in a mixed system directory, which makes it easier to work with multiple versions.)

OpenXR then built cleanly with the standard make and make install operations:

% cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebugInfo -DCMAKE_INSTALL_PREFIX:PATH=<install-dir> <source-dir>
[...]
% make
[...]
% make install
[...]

OpenXR Applications

Once the OpenXR library is built it will include 3 test programs, one of which (HelloXR) produces graphical output that can be used to test the OpenXR runtime.

Running an OpenXR Application

OpenXR applications require a runtime to provide the input and output interfaceto the user. The XR_RUNTIME_JSON environment variable informs the application of the location of the runtime configuration file (e.g. active_runtime.json). That JSON file sets particular parameters of the runtime.

Also, before running the OpenXR application ensure that the OpenXR runtime is operating. That runtime could be Monado or SteamVR for example. The run the application. In the case of hello_xr different graphics rendering libraries can be selected as well as the expected form-factor:

% export XR_RUNTIME_JSON=/home/myhome/MonadoInstallDir/etc/xdg/openxr/1/active_runtime.json
% hello_xr -g OpenGL -ff hmd

You should then see the application running in the VR display controlled by whichever OpenXR runtime it is connected to.

Available OpenXR Applications

To my knowledge, there are not (yet) many widely available OpenXR applications available for Linux. Here are three applications I'm aware of:

  • HelloXR — a test program provided by the OpenXR-SDK
  • Godot game engine — I have not personally tried this
  • VTK — well, this isn't working yet, but hopefully will be soon.

See Also