Virtual Reality supports the following VR interfaces:
- SteamVR: HTC Vive, HTC Vive Pro, HTC Vive Pro Eye, Valve Index, HP Reverb G2, and others.
- Oculus: Rift, Rift S
- Varjo: VR-1, VR-3, XR-1, XR-3
- VRG: XTAL
Using Virtual Reality in Prepar3D
- Ensure that the headset is plugged in and working, and that the latest runtime and firmware updates for your hardware are installed.
- For Oculus Rift, ensure that Allow 3rd Party Content is checked in the Oculus Home settings.
- Start Prepar3D.
- Click on the Virtual Reality menu.
- Select Enable Virtual Reality and then select the desired runtime for the headset (SteamVR, Oculus, Varjo, VRG, or HMD Emulator).
- Prepar3D should now be visible inside the virtual reality headset.
- Select Recalibrate Origin to reset the position of the headset to where you are sitting.
- The active view can be changed through the Views menu.
Display Modes
After enabling virtual reality, the menu dropdown will have additional options allowing you to further configure your experience.Recalibrate Origin
- Recalibrate Origin centralizes your view point to ensure you are aligned correctly with the visual scene. This can also be configured in the Controls as a Key Assignment (HMD - Recalibrate Origin).
Headset Display Modes
- Stereo uses two views (one per-eye) to provide depth perception. This can be performance intensive, but provides the most immersive 3D visual effect.
- Single-Pass Stereo is a stereo mode that draws two views in a single rendering pass. For high-end CPUs and GPUs, this should be faster in most cases. On AMD GPUs, MSAA and SSAA will be disabled when in this mode.
- Mono uses a single view which provides a performance increase, but no depth perception. Some headsets do not support this setting including Varjo VR-1.
On-Screen Display Modes
- Single view combines what is seen in the headset to one view.
- Double view shows what is rendering in both eyes, showing one eye per-view on the screen.
Virtual Reality Settings
Configuration options can be found the VirtualReality.xml file located in %PROGRAMDATA%\Lockheed Martin\Prepar3D v5
HeadsetDisplayMode
represents the in headset display mode.
- 0 is Stereo
- 1 is Mono
- 2 is Single-Pass Stereo
OnScreenDisplayMode
Represents the on screen display which determines how the VR scene is displayed on the external display. There is a small performance advantage to using the Single mode.
- 0 is Single
- 1 is Double
SyncMode
This determines when the sync for an HMD will be called. This setting currently only impacts SteamVR and Varjo.
- Update - Lowest latency. (This mode is currently required for WindowsMR headsets to work properly)
- Pre-Render - Recommended for best performance
Enable Hidden Area Mesh
Disabling this will remove the hidden area mesh surrounding the VR headset. Default: Enabled
Enable Mirror Texture
Use a mirror texture provided by the HMD for the on screen display. The On Screen Display Mode determines the mirror texture layout. Currently this feature is only supported for Varjo HMD. Enable this to see the image overlay from the Varjo XR camera within the P3D application window. There is a performance cost to using this feature, so it is recommended that this is disabled unless it is required. Default: Disabled
Enable Zoom
Enables the user to zoom in the view while in VR. Default: Disabled
Resolution Scale
Scale resolution of the VR views. Currently only Varjo interface impliments this setting. Most VR platforms have dedicated settings for this. Default: 1.0
Max View Count
Some HMDs can utilize 4 views. As a performance trade off, these HMDs ususally support running with two higher resolution views. Two high resolution views combined with variable rate shading (supported by Varjo and VRG) may perform better than 4. Four lower resolution views can be used when foveated rendering is enabled. This replaces the Varjo Views option which was previously in Varjo specific settings. Default: 4
Eye Tracking Settings
The cursor in Virtual Reality is visualized by a sphere in 3D space based on the mouse position relative to the Prepar3D window. This cursor will not work if you move your mouse to a monitor that is not displaying Prepar3D. The Mouse Cursor and the Virtual Reality cursor will not be at the same location on the screen.
EnableEyeTracking
Turning this on sets the cursor to the eye position. If Eye tracking is not supported the cursor will be placed at the center of the screen. The Vive Pro Eye is currently the only native eye tracking HMD supported by Prepar3D.
EnableGazeDetection
Turning this on displays Green Spheres for Eye Tracking data when P3D is paused, similar to a heat map to show the areas that were looked at most.
EnablePanelEyeData
Turning this on displays a single Green Sphere for where the User is looking along with text data about the Eye such as Openness, Pupil Diameter, and screen Location
EnableGazeSelection
Turning this on locks the cursor to the center of the screen, requiring head movement to move the cursor around.
When Gaze Selection is enabled, you can use the following Key Controls to emulate the functions of mouse clicks to interact with the Virtual Cockpit in VR. This can be useful for users that need mouse controls for interaction with the Virtual Cockpit while wearing a VR Headset, allowing them to 'click' VC elements using keys or buttons on a control surface, instead of operating a mouse. The emulated mouse clicks will interact with the Virtual Cockpit elements underneath the cursor.
To emulate:
- Left Mouse Click: Map Key Controls for HMD - Gaze Click Down and HMD - Gaze Click Up. Ideally, Up should be mapped to the same key or button as Down, but with the On Release check box checked.
- Right Mouse Click: Map Key Controls for HMD - Gaze Right Click Down and HMD - Gaze Right Click Up. Ideally, Up should be mapped to the same key or button as Down, but with the On Release check box checked.
- Mouse Scroll Wheel: Map Key Controls for HMD - Gaze Scroll Down and HMD - Gaze Scroll Up. These controls should be mapped to two separate keys or buttons.
GazeDragVelocity
Specifies the speed and direction of the mouse drag when EnableGazeSelection is toggled on. This may need to be adjusted per aircraft.
GazeSelectionOffset
Moves the cursor position (in pixels).
EnableFoveatedRendering
A performance optimization where the image is rendered in higher detail in the area where the eyese are looking. This requires Max View Count be set to Four Views and is currently supported only by the Varjo and VRG interfaces.
EnableVariableRateShading
A performance optimization where the image is rendered in higher detail in the area where the eyese are looking. Instead of using 4 views, this method uses 2 high resolution views. The GPU scales the pixel workload in the focus areas utilzing a Dx12 feature called Variable Rate Shading or VRS. This requires a GPU that supports VRR, and is currently only implimented for Varjo and VRG HMDs.
User Interface Settings
MouseHitDistance
Specifies the max distance (in meters) the object can be for the mouse to detect it. This may need to be adjusted per aircraft..
MouseCursorRadius
Changes the radius of the Virtual Reality Cursor. (Default is 0.0125)
MouseCursorOpacity
Changes the opacity of the Virtual Reality Cursor. (Default is 200)
MouseCursorColor
Changes the color of the Virtual Reality Cursor. (Default is 200, 200, 250)
ShowAppMenu
Enable application menu to display in a 3D window in VR
ShowInfoGen
Enable Information window to display in a 3D window in VR
ShowPortalEditControls
Show portal edit controls help text in a floating 3d window. This will still only display if a passthough camera is enabled and a motion controller is used.
Prepar3D Config
In the Prepar3D.cfg, there are the following Virtual Reality entries:
- LoadVirtualReality: sets whether Prepar3D will load the Virtual Reality library. This is enabled by default. Setting this to 0 will disable Virtual Reality from loading.
- EnableVirtualRealityOnStartup: sets whether Prepar3D will load into Virtual Reality on startup. This is disabled by default. Setting this to 1 will enable Virtual Reality automatically when Prepar3D starts.
- EnableViveProEyeTracking: sets whether Prepar3D will load the SRanipal Vive Pro Eye Tracking libraries (v0.5). This is disabled by default. Enable Eye Tracking in the VR Settings must also be enabled.
To automatically enable a VR Interface at Startup, edit the 'EnableVirtualRealityOnStartup' variable found in the Prepar3D.cfg file.
Options for Startup VR Interfaces are:- 0: Disabled - VR will not initialize at startup
- 1: SteamVR - P3D will initialize the SteamVR Interface at startup
- 2: Oculus - P3D will initialize the Oculus Interface at startup
- 3: Varjo - P3D will initialize the Varjo Interface at startup
- 4: HMD Emulator - P3D will initialize the HMD Emulator at startup
- 5: VRG - P3D will initialize VRG Interface at startup
For Example, to automatically start SteamVR for a VIVE Pro HMD (or any other openVR HMD) when P3D starts, my Prepar3D.cfg file would have the following entry:
Instrument Panels
If an Instrument Panel is opened before entering Virtual Reality, it will be shown in the headset. An Instrument Panel can be opened by selecting the Vehicle menu item and choosing Instrument Panel. Note that not all vehicles have Instrument Panels.
Controls
- Translate: LeftMouseDown + Shift
- Rotate X Axis: LeftMouseDown + Ctrl + ScrollWheel
- Rotate Y Axis: LeftMouseDown + Ctrl + '
- Rotate Z Axis: LeftMouseDown + Ctrl + PlusKey
- Uniform Scale: LeftMouseDown + Shift + Ctrl
- Resize Panel: LeftMouseDown + Shift + Tab
NOTE: The Virtual Reality cursor must be hovering over the panel to move it.
Developer Mode
Turning on Developer Mode will enable a new headset interface selection in the Virtual Reality drop down menu called HMD Emulator. The HMD Emulator allows Virtual Reality to be enabled without plugging in a headset. Panning can be used to simulate head movement.
Augmented Reality
Overview
Augmented Reality is available for those who have an headset with passthrough camera capabilities (ie. HTC Vive, Varjo, etc.) Developer mode must be enabled to see the Passthrough Camera menu item under Virtual Reality. A passthrough camera must be selected to utilize any AR functionality. The following settings can be found in the AR Settings UI.
EyepointZOffset
Value that corrects the position of camera where the camera is offset from the headset eyepoint.
EnableGreenScreen
Value that enables the green screen for Passthrough cameras. See advanced settings for how to configure chromakey color values.
Passthrough Mode
Selects which mode the passthrough camera will operate in.
- Camera: Feed from selected camera will be displayed in the headset.
- Portals: Feed from the camera only displayed within placed portals.
- Inverted Portals: Prepar3D scene rendered within placed portals.
Mixed Reality Portals
Portals are masking areas where either the passthrough camera feed is displayed or the Prepar3D scene is displayed. You can enable and disable groups of portals (portal sets) through the drop down menu. An entire set can be deleted in the VR Settings UI. VIVE controllers are necessary for real-time portal placement. Otherwise, they can be created in the UI, or through the Portals.xml file.
Note: You will need to have a Passthrough Camera enabled and your Passthrough Mode set to Portals in order to see portals.
Using Portals
Your controllers will need to be in Portal Edit Mode to directly manipulate portals in the Virtual Environment. Edit mode is enabled if you see the controllers pulsating a green hue. The selected portal will also appear green in this mode. You can select a portal by passing the controller through it. Delete will only delete a selected portal. Creating a portal without having a portal selected will create a new portal set. See the Portal Controls table below for more info on how to enter Portal Edit Mode and the available controls. Delete will only delete a selected portal. Creating a portal without having a portal selected will create a new portal set.
Portal Controls
The first controller that the system recognizes is assigned the Left Hand role. If it feels more natural to have the roles swapped, simply switch the controller hands.
The following table displays the controls for each operating mode. The default mode is entered when an AR pass through camera is selected. Once controllers are connected, you will see 3D representations of the controllers in the Virtual Environment. Pressing the trigger will bring up the Help Text, which hovers over the mouse cursor and displays the controls for the current mode.
Controller Modes when using Mixed Reality Portals:
- Default Mode: Mode you will enter when first enabling AR. Checks for input to enter other modes. Controllers appear gray in this mode.
- Portal Edit Mode: In this mode, you can create, resize, move, and delete MR portals with the controllers. Controllers pulse green in this mode.
- FOV Edit Mode: In this mode, you can increase and decrease the Horizontal and Vertical Field of View of applicable AR cameras. Controllers pulse blue in this mode.
If you only have one controller, you can use the Grip Button on the Left Controller to emulate Right Controller functions. Simply press the grip button, and the color of the label on the Left Controller will toggle to indicate the controller has switched functionality.
Left Controller | Default Mode | Portal Mode | FOV Mode |
---|---|---|---|
DPAD Up/Down | Toggle Help Text | Create Portal | Scale Vertical FOV |
DPAD Left/Right | Toggle Help Text | Cycle Portal Shape | Scale Horizontal FOV |
Menu | Enter FOV Mode | Delete Portal | Exit FOV Mode |
Trigger | Toggle Help Text | Move Portal | --- |
Grip | Toggle 'Right' Controls | Toggle 'Right' Controls | Toggle 'Right' Controls | Right Controller | Default Mode | Portal Mode | FOV Mode |
DPAD Up/Down | Enter Portal Mode | Exit Portal Mode | Scale Vertical FOV |
DPAD Left/Right | Enter Portal Mode | Cycle Portal Origin | Scale Horizontal FOV |
Menu | Enter FOV Mode | --- | Exit FOV Mode |
Trigger | Toggle Help Text | Move Portal | --- |
Eye Tracking
Overview
In Prepar3D, eye tracking takes on a new meaning in training and simulation. Demonstrate your awareness of start-up procedures while controlling knobs and switches as you use your eyes to follow instructions. Review which panels, knobs, and other areas in the current view have been given the most attention by pausing the simlation and seeing the most frequented regions marked by concentrated green circles. Where your eyes travel and how long they remain there provide not only useful functionality but interesting insights that can revolutionize the way you train.
Eye Tracking Setup
Prepar3D currently supports eye tracking using the HTC VIVE Pro Eye, as well as Varjo, and VRG headsets. Because of the uniqueness of these devices, it is important to understand the proper way to enable and configure eye tracking for use in Prepar3D.
Using Eye Tracking with HTC VIVE Pro Eye
HTC VIVE Pro Eye makes use of the SR (Super Reality) runtime to enable eye tracking capabilities. Please ensure the latest version of
the SR runtime is installed on your device. This should be installed from having run the VIVE software installer, but may have not been
included in the installation if the installer was ran for a prior VIVE (non-VIVE Pro Eye) headset. If you are missing the SR runtime, you may get it by following the instructions at
https://www.vive.com/us/support/vive-pro-eye/category_howto/installing-eye-tracking-software.html.
Additional things to note while using eye tracking with the VIVE Pro Eye are the following:
Note: To configure Prepar3D to start up with virtual reality enabled for the HTC VIVE Pro Eye, set "EnableVirtualRealityOnStatup" to 1 in Prepar3D.cfg.
Using Eye Tracking with Varjo VR-1
Varjo VR-1 uses Varjo Base to enable both position and eye tracking. Please ensure the latest version of Varjo Base is installed on your device. If you have not yet installed Varjo Base, you may find it at
https://varjo.com/downloads/#varjo-base.
Additional things to note while using eye tracking with the VR-1 are the following:
Note: To configure Prepar3D to start up with virtual reality enabled for the Varjo VR-1, set "EnableVirtualRealityOnStatup" to 3 in Prepar3D.cfg.
Advanced Settings (Professional Plus)
Overview
These are settings intened for advance mixed reality training use cases where additional tracking capabilities and scene blending techniques are required to correlate objects in the real world with the virtual scene.
Recalibration Origin
HMDReferenceOrigin
Controls the origin Prepar3D will use during recalibration. This is used to set whether Prepar3D will use the zero pose coming in from HMD software as the calibration center, or if Prepar3D will calculate it's own offsets to center the HMD.
- HMD Zero Origin: Default option, recalibrate via the HMD's interface. Recalibration triggers external software to update the HMD.
- P3D Custom Origin: Recalibration will be handled by Prepar3D, not an external request to HMD software. This is useful to only recenter the HMD without recalibrating all VR objects.
- P3D Tracker Origin: Recalibrate via HMD interface, but enables tracker options for saving and loading a custom origin using a tracker. The Tracked Device Class option determines what type of tracker is used. The first tracker found for this device class will be used. Tracker objects are sorted from right to left relative to the HMD.
Tracked Device Class
The class of tracked device to use as a reference for saving and loading the origin offset.
- Tracking Reference: Use the tracking reference (Base Station). This is the default option.
- Controller: SteamVR compatible tracked controller
- Generic Tracker: SteamVR tracking puck or custom device using the SteamVR tracking API.
AutoRestoreOrigin
If HMDReferenceOrigin is set to P3D Tracker Origin and this option is enabled, the custom tracker origin will be reset shortly after enabling VR. Tracker objects are sorted from right to left relative to the HMD, so it is important if this option is used, that the HMD be generally facing in the correct direction at the time VR is enabled, or the wrong tracker may be selected.
UseTrackerAsCameraOrigin
This option will use the trackers location as the camera origin. Each frame the tracker location is updated and a new custom origin is set at the trackers location. This is intended for special cases such as motion platforms. The camera in the training scenario should be offset to be placed at the same location as the tracker in the real world cockpit. This setting is experimental.
Using Tracker Origin
Tracker Options: Menu item group that shows up in the Virtual Reality Menu when in P3D Tracker Origin mode
- Save Offset: Saves the offset of the tracker relative to the current callibrated origin.
- Restore Offset: Uses the current tracker offset and saved tracker offset to restore the tracking origin to the state it was in when the offset was last saved.
- Visualize Tracker Position: Enable this to get a visual representation of the tracker and origin.. This will show the current origin in blue, the current tracker location in red, and the saved tracker offset in yellow. If multiple trackers are found, they are sorted from right to left relative to the HMD and the first one is used. Because the sort is HMD relative, the HMD can be repositioned to determine which tracker is used.
Note: P3D Custom Origin and Tracker Origin currently only supported for OpenVR and Varjo HMDs.
The recommended combination of settings to use for XR training with Varjo HMDs is:- HMDReferenceOrigin: P3D Tracker Origin
- TrackedDeviceClass: Tracking Reference
- AutoRestoreOrigin: Enabled
- UseTrackerAsCameraOrigin: Disabled
KeyColorValue
Color that will be keyed out and replaced with Prepar3D scene.
KeyColorThreshold
How much margin of error is allowable for the key color value. X represents min, Y represents max. The threshold is applied to each color channel (red, green, and blue.) The larger the threshold, the wider the color range being keyed out will be.
Color Picker
Sets the KeyColorValue based on the color in the center of the camera's vision. To use, point the camera so that the desired color to be keyed out is roughly in the center of the screen, then press the Color Picker button. The KeyColorValue field will be filled out for you.
HMD Specific Settings (Professional Plus)
Varjo Settings and Configuration
Settings
VarjoEnableChromaKey
Enables the XR-1 camera passthrough to overlay the chosen greenscreen color. Disabled by default. (Enable XR1 Camera must be enbaled)
Enable XR-1/XR-3 Camera
This will allow the XR camera to be selectable from the camera passthrough system.
Varjo Chroma Key Color
This is the chosen color for the chroma key. The default color used below is a pure green RGB of (0, 255, 0). Hue Range: 0 - 360 Saturation and Brightness Range: 0-100, Default: (120, 100, 100)
Varjo Chroma Key Falloff
Falloff is the size of the fade at the edge of the tolerance, think of this as a slight blur on the edges of chroma. Typically want to keep these values small. Range: 0-100, Default: (3, 3, 3)
Varjo Chroma Key Tolerance
This is the hard cut off of what is considered chroma and what isn't. Range: 0-100, Default: (3, 75, 50)
Enabling XR-1 Camera
- Start Prepar3D.
- Activate Varjo (Virtual Reality > Enable Virtual Reality > Varjo)
- Open VR Settings (Virtual Reality > VR Setting)
- Under Varjo Settings select Yes for Enable XR1 Camera
- Activate the XR-1 (Virtual Reality > Passthrough Cameras > XR-1)
Using Cockpit Masking
- Start Prepar3D.
- Navigate to Custom Camera Management. (Views > View Management > Manage Cameras)
- In the Available Cameras menu choose Virtual Cockpit. (This is selected by default)
- In the Camera Effects menu scroll down and enable "MaskVCAlphaAndColor"
- In the Camera View menu give your new camera a name. I'll call it "XR-1 View"
- (Optional) In the Save To dropdown, choose Global so you won't have to re-create the camera next time you run.
- Save the camera and exit out of the Custom Camera Management menu
- Change views to the new camera (Views > Change View > Cockpit > XR-1 View