Virtual reality
|
| |
| Started in | 07/2021 |
|---|---|
| Description | Virtual Reality support using osgXR / OpenXR |
| Contributor(s) | James Hogan [1] |
| Status | Active |
The virtual reality project aims to add immersive VR support to FlightGear. This is done using the OpenXR[2] API, via an external library called osgXR[3] for handling OpenXR and OpenSceneGraph specifics, which is being developed in parallel.
Usage & Controls
Headphones Setup
If you use headphones, or have speakers attached to your headset, enable "Head tracked sound (for headphones)" in the VR Options dialog (in the View menu). This will make surround sound relative to your head orientation. You can also enable binaural audio using HRTF filters in OpenAL to get better stereo surround sound.
Enabling VR
You can enable / disable VR at startup via the --enable-vr / --disable-vr command line options, or at runtime using the VR Options dialog (in the View menu).
VR Specific Controls
To use a mouse in VR, use the 360 mouse mode which captures the mouse and allows you to move it all around you. If you are using an OpenXR runtime which supports user presence detection then it will be enabled automatically while you have your headset on (if not you can toggle it manually using a keyboard shortcut).
You can use the following shortcuts on the next branch:
|
Performance
Here are some pointers to get the best VR experience.
- Ensure your runtime supports asynchronous reprojection, which may alleviate the nausea induced by lower frame rates.
- On Linux / SteamVR / NVidia proprietary driver, ensure you have at least driver version 270.
- If your frame rate is being capped at the refresh rate of your desktop monitor, try disabling VSync in both flightgear settings and your driver settings
- On Linux / NVidia proprietary driver, its found in OpenGL settings in nvidia-settings.
- If FlightGear is getting throttled by SteamVR (to try and ensure a consistent, if slow, frame rate), consider switching to fixed throttling (in per-application video settings) and playing with the sliders. You may prefer no frame rate throttling but a higher predicted frame time.
- Enabling multithreading may get you better performance, e.g.
--prop:/sim/rendering/multithreading-mode=CullThreadPerCameraDrawThreadPerContext - If using an AMD GPU, use CoreCtrl and set the GPU to the "Virtual Reality" power profile with GPU and memory clocked to max. You may also benefit from changing the CPU frequency governor to Performance.
Building & Packaging Notes
When CMake runs for FlightGear (next or osgxr/osgxr_clean branches), by default it will attempt to enable VR on Windows and Linux (same as -DENABLE_VR=ON). It will do the following:
- Look for the osgXR library, and if found it will link against that (same as
-DSYSTEM_OSGXR=ON). - If no osgXR library is found it will check for OpenXR and if found it will build its own static built-in copy of osgXR to use.
- If no OpenXR is found it will disable VR support.
In any case it will print a message along the lines of -- VR support enabled/disabled....
To avoid implicit dependencies when packaging, packagers may need to do ONE of the following:
- preferably depend upon an osgXR package providing the osgXR dynamic library
- OR depend on OpenXR and GLX, and explicitly pass
-DSYSTEM_OSGXR=OFFto CMake so the built-in osgXR is built statically - OR explicitly pass
-DENABLE_VR=OFFto CMake to disable VR support altogether
Development
|
|
References
References
|