Parent task to manage review of the Core Support of VR Headsets through OpenXR GSoC 2019 project. All these changes are a target for 2.82.
Relevant patches are attached.
The project aimed at bringing stable, well performing VR rendering support to Blender, based on the new OpenXR specification. Further, debugging utilities should be added. A fully fledged VR experience, e.g. with support for editing 3D content with controllers, was not in scope of the project.
How to Test
Testing this patch isn't as simple as applying it and compiling with it. Information on how to test can be found here.
In short, the following is needed:
- Install an OpenXR runtime.
- Checkout the soc-2019-openxr Add-ons branch.
- Install/build the OpenXR-SDK (already bundled with precompiled Windows libs, use install_deps.sh on Linux).
- After a successful build, enable Basic VR Viewer Add-on.
- Launch the session through Window → Toggle VR Session.
- OpenXR loader from the OpenXR SDK to connect to the System’s active OpenXR runtime.
- OpenXR extension (and API-layer) management.
- Basic OpenXR event management.
- VR session management.
- Well performing VR rendering - more performance improvements are possible, but we have a quite decent baseline.
- Carefully designed error handling strategy, cancelling the VR session with a useful user error message (e.g. “Failed to get device information. Is a device plugged in?") and no side-effects to the rest of Blender.
- Compatibility with DirectX-only runtimes.
- --debug-xr command line option enabling our own debug/information prints, OpenXR debug prints and the OpenXR core validation layer.
- --debug-xr-time command line option to print frame render times and FPS information.
- wmSurface API to manage offscreen drawables without a wmWindow.
- Abstraction (currently a GHOST_Xr-API) for all OpenXR specific code. Makes higher level usage easier, but most importantly, improves maintenance (esp. when updating OpenXR versions).
- Add-on to hide VR features by default from the UI.
If needed I can explain features in more detail, for now keeping it short.
Visibility for Users
Showing a "Toggle VR Session" button in the UI by default may fool users into thinking there was full fledged VR support in Blender. To not disappoint users with false promises, I wrapped this button into an Add-on which is disabled by default. The Add-on description clearly warns that support is limited and an early preview.