Qt Quick 3D (Xr Module)
The purpose of this module is to demonstrate the usage of Qt Quick 3D with OpenXR.
OpenXR dependency setup (windows)
Download this repository: https://github.com/KhronosGroup/OpenXR-SDK-Source
Build and install somewhere, for example I installed mine to:
D:/SDK/OPENXR
Then for CMake to be able to find the SDK with findPackage you need to setup and environment variable (replacing the path with your installation prefix)
OPENXR_ROOT=D:/SDK/OPENXR
Then you should be able to build this module.
Getting OpenXR to work with an Oculus HMD
The OpenXR SDK just provides a loader, but individual XR device providers provide the actual OpenXR runtime that is loaded. In the case of Oculus HMD(s) there isn't yet support for OpenXR out of the box. So you need to do a bit of setup first.
First create a file called openxr.json
somewhere on your system. I put mine in D:/SDK/openxr.json
The add the following content:
{
"file_format_version": "1.0.0",
"runtime":
{
"api_version": "1.0",
"name": "Oculus OpenXR",
"library_path": "c:\\Program Files\\Oculus\\Support\\oculus-runtime\\LibOVRRT64_1.dll"
}
}
If you installed the Oculus software somewhere other than the default you may need to adjust the library_path
value.
Then you need to add a registry values in the following location:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenXR\1
Inside this area add a REG_SZ value called ActiveRuntime
with the value of the location of the openxr.json
file you created. This will enable the use of OpenXR with the Oculus runtime.