This project demonstrates how you can write your own VR application using OpenXR 1.1 and Vulkan 1.3. These are its main features:
- Basic rendering of example scene to the headset and into a resizeable mirror view on your desktop monitor.
- Focus on easy to read and understand C++ without smart pointers, inheritance, templates, etc.
- Usage of the Vulkan
multiview
extension for extra performance. - Warning-free code base spread over a small handful of classes.
- No OpenXR or Vulkan validation errors or warnings.
- CMake project setup for easy building.
Integrating both OpenXR and Vulkan yourself can be a daunting and painfully time-consuming task. Both APIs are very verbose and require the correct handling of countless minute details. This is why there are two main use cases where this project comes in handy:
- Fork the repository and use it as a starting point to save yourself weeks of tedious integration work before you get to the juicy bits of VR development.
- Reference the code while writing your own implementation from scratch, to help you out if you are stuck with a problem, or simply for inspiration.
- Download the latest release or build the project yourself with the steps below.
- Make sure your headset is connected to your computer.
- Run the program!
- Install the Vulkan SDK version 1.3 or newer.
- Install CMake version 3.1 or newer.
- Clone the repository and generate build files.
- Build!
The repository includes binaries for all dependencies except the Vulkan SDK on Windows. These can be found in the external
folder. You will have to build these dependencies yourself on other platforms. Use the address and version tag or commit hash in version.txt
to ensure compatibility. Please don't hesitate to open a pull request if you have built dependencies for previously unsupported platforms.
Asset | Title | Author | License |
---|---|---|---|
models/Beetle.obj |
Car Scene | toivo | CC BY 4.0 |
models/Bike.obj |
Sci-fi Hover Bike 04 | taktelon | CC BY 4.0 |
models/Car.obj |
GAZ-21 | Ashkelon | CC BY 4.0 |
models/Hand.obj |
Hand Anatomy Reference | Ant B-D | CC BY 4.0 |
models/Ruins.obj |
Ancient Ruins Pack | Toni García Vilche | CC BY 4.0 |