a barebones example of how to integrate OpenXR with wgpu (Vulkan-only)
It has four modes:
cargo run --no-default-features
: desktop-only, renders the scene without any XR integrationcargo run -- desktop
: build with XR support, but render the scene without initialising XRcargo run -- desktop-with-xr-resolution
: build with XR support, initialise XR, but do not render to headsetcargo run -- xr
: build with XR support, and render to the headsetThese modes are intended to show you how to gracefully integrate XR into your project's code and how you can move from one stage of integration to the next.
Note that this code is not production-quality; there are a few shortcuts that have been taken in the interest of keeping it simple and relatively modular. Make sure to clean up your resources properly and use robust code where possible :)
The code renders three instances of a triangle (two being the controllers) to a multi-view render target.
Rendering to a render target is necessary to accommodate these:
BGRA8888
, while my OpenXR runtime offers RGBA8888
.It should theoretically be possible to do the following:
Cobbled together from the following sources: