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.
Difference between revisions of "OpenXR"
(Created page with my recipe for building/using OpenXR on Linux) |
m (Added new links to the available applications and see also sections) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 45: | Line 45: | ||
==Running an OpenXR Application== | ==Running an OpenXR Application== | ||
OpenXR applications require a runtime to provide the input and output interface to the user. | OpenXR applications require a runtime to provide the input and output interface to the user. | ||
The <TT>XR_RUNTIME_JSON</TT> environment variable informs the application | The <TT>XR_RUNTIME_JSON</TT> environment variable informs the application of the | ||
runtime configuration file (<TT>active_runtime.json</TT>) | location of the runtime configuration file (e.g. <TT>active_runtime.json</TT>). | ||
sets particular parameters of the runtime. | That JSON file sets particular parameters of the runtime. | ||
Also, before running the OpenXR application ensure that the OpenXR runtime | Also, before running the OpenXR application ensure that the OpenXR runtime | ||
is operating. That runtime could be [[Monado]] or SteamVR for example. | is operating. That runtime could be [[Monado]] or SteamVR for example. | ||
Then run the application. In the case of <TT>hello_xr</TT> different | |||
graphics rendering libraries can be selected as well as the expected | graphics rendering libraries can be selected as well as the expected | ||
form-factor: | form-factor: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
% export XR_RUNTIME_JSON=/home/myhome/MonadoInstallDir/etc/xdg/openxr/1 | % export XR_RUNTIME_JSON=/home/myhome/MonadoInstallDir/etc/xdg/openxr/1/active_runtime.json | ||
% hello_xr -g OpenGL -ff hmd | % hello_xr -g OpenGL -ff hmd | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 63: | Line 61: | ||
You should then see the application running in the VR display controlled | You should then see the application running in the VR display controlled | ||
by whichever OpenXR runtime it is connected to. | by whichever OpenXR runtime it is connected to. | ||
===Changing XR parameters=== | |||
Some parameters of the XR system can be affected through environment variables. | |||
The most useful of these environment variables are the ones that change the | |||
tracking offset, which is particularly hand when tracking isn't operating, and | |||
you want to put the dummy camera in a particular location: | |||
<syntaxhighlight> | |||
% export OXR_TRACKING_ORIGIN_OFFSET_X=3 | |||
% export OXR_TRACKING_ORIGIN_OFFSET_Y=3 | |||
% export OXR_TRACKING_ORIGIN_OFFSET_Z=2 | |||
</syntaxhighlight> | |||
Note that these are done in the shell prior to calling the OpenXR application | |||
(and not in the shell for the runtime). | |||
==Available OpenXR Applications== | ==Available OpenXR Applications== | ||
Line 69: | Line 80: | ||
* HelloXR — a test program provided by the OpenXR-SDK | * HelloXR — a test program provided by the OpenXR-SDK | ||
* [https://godotengine.org/article/godot-openxr-support Godot game engine] — I have not personally tried this | * [https://godotengine.org/article/godot-openxr-support Godot game engine] — I have not personally tried this | ||
* [https://vtk.org VTK] — | * [https://vtk.org VTK] — the working version will be merged into nightly soon. | ||
* [https://gitlab.freedesktop.org/xrdesktop/xrdesktop xrdesktop] (Gitlab) | |||
* [https://gitlab.com/madsbuvi/openmw openmw open-world RPG engine w/ VR] (Gitlab) | |||
* [https://devtalk.blender.org/t/gsoc-2019-vr-support-through-openxr-weekly-reports/7665 Blender GSoC reports] | |||
* [https://beastsaber.notion.site/beastsaber/Useful-OpenXR-Projects-for-Modding-fcac28c4f57845dea007a19b90b1580d Useful OpenXR Projects for Modding] | |||
=See Also= | =See Also= | ||
Line 75: | Line 90: | ||
* [https://www.khronos.org/files/openxr-10-reference-guide.pdf OpenXR Quick Reference document (PDF)] | * [https://www.khronos.org/files/openxr-10-reference-guide.pdf OpenXR Quick Reference document (PDF)] | ||
* [https://docs.microsoft.com/en-us/windows/mixed-reality/develop/native/openxr-best-practices Microsoft MR OpenXR best practices document] | * [https://docs.microsoft.com/en-us/windows/mixed-reality/develop/native/openxr-best-practices Microsoft MR OpenXR best practices document] | ||
* [https://playdeck.net/blog/introduction-to-openxr Playdesk Project's Introduction to OpenXR] (Uses or works with StereoKit) |
Latest revision as of 19:30, 13 December 2023
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 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. Then 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.
Changing XR parameters
Some parameters of the XR system can be affected through environment variables. The most useful of these environment variables are the ones that change the tracking offset, which is particularly hand when tracking isn't operating, and you want to put the dummy camera in a particular location:
% export OXR_TRACKING_ORIGIN_OFFSET_X=3
% export OXR_TRACKING_ORIGIN_OFFSET_Y=3
% export OXR_TRACKING_ORIGIN_OFFSET_Z=2
Note that these are done in the shell prior to calling the OpenXR application (and not in the shell for the runtime).
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 — the working version will be merged into nightly soon.
- xrdesktop (Gitlab)
- openmw open-world RPG engine w/ VR (Gitlab)
- Blender GSoC reports
- Useful OpenXR Projects for Modding