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 01:34, 26 February 2022 by WSherman (talk | contribs) (Created page with my recipe for building/using OpenXR on Linux)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 interface to the user. The XR_RUNTIME_JSON environment variable informs the application where the runtime configuration file (active_runtime.json) should b e found. That file sets particular parameters of the runtime.

[ASIDE: why the environment variable doesn't just directly point to the config file? I don't know.]

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
% 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