This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

HTC Vive Output with OpenVR Plugin

Warning
The plugin is deprecated. VR functionality is available out of the box since 2.18 for all supported graphics APIs except OpenGL.

The OpenVR plugin is used to support both the HTC Vive and the HTC Vive Pro head-mounted displays. It is supposed that you already have HTC Vive/Vive Pro HMD installed. SteamVR will be set automatically on the HTC Vive (HTC Vive Pro HMD) installation.

Notice
The plugin supports only DirectX 11 and OpenGL APIs. For other graphics APIs, use the built-in VR functionality.

Both the windowed and the full screen modes are supported. By default, on the PC display the image is rendered in mono mode (image from the left eye). Use setViewportMode() to change the mode to stereo (both eyes) as follows:

All UNIGINE projects supporting SteamVR are compatible with both HTC Vive and HTC Vive Pro. However, please note that Vive Pro has a higher display resolution, and although no modifications are required, it is recommended to check your project's performance and optimize it accordingly.

See Also

  • OpenVR class in API reference
  • <UnigineSDK>/data/samples/plugins/app_vive_00 sample

To run the plugin sample from the UNIGINE SDK Browser, go to the Samples tab, choose UnigineScript -> App and run the app_vive_00 sample.

Implementing Unigine Application with OpenVR Support#

To use the HTC Vive virtual display with Unigine, perform the following:

  1. Download Vive Setup and perform all required steps.
  2. Create a new project with OpenVR support via UNIGINE SDK Browser: click Plugins, check the OpenVR support (OpenVR plugin) option in the form that opens and click OK.

    Notice
    To add OpenVR support to an existing project, in UNIGINE SDK Browser, click Other Actions -> Configure Project -> Plugins -> OpenVR support (OpenVR plugin) -> Ok.

  3. Implement the application logic by using functions of the OpenVR plugin API.
  4. Plug in the HTC Vive virtual display.
  5. Launch the OpenVR plugin on the application start-up.

Launching OpenVR#

To launch the plugin, specify the extern_plugin command line option on the application start-up:

Shell commands
main_x64.exe -extern_plugin "UnigineOpenVR"
Notice
Launching the OpenVR plugin is not possible when the built-in VR is initialized, as it overrides the functionality of the plugin.

If you run the application via UNIGINE SDK Browser, set the Stereo 3D option to HTC Vive in the Options tab and click Apply:

OpenVR Options#

The following CLI options can be specified on the application start-up:

  • openvr_render_width and openvr_render_height - set a resolution for each eye. The default resolution for one eye is set equal to recommended value by SteamVR.

    Please note that by default SteamVR selects resolution based on your computer's performance. Therefore, for best image quality it is recommended to open the Video tab of the SteamVR settings window, enable Manual Override mode and set resolution to 100%.

    So the resolution will be set as follows:

    HTC Vive HTC Vive Pro
    Resolution per eye 1512 x 1680 2016 x 2240
    Notice
    The same resolution is set for both eyes.
Shell commands
main_x64d -extern_plugin "UnigineOpenVR" -openvr_render_width 1512 -openvr_render_height 1680

Console Commands#

The following console commands can be run for the OpenVR plugin.

Name Description Arguments
vr_viewport_mode
  • Command. Sets the viewport mode.
  • Variable. Prints the value specifying which viewport mode is set.
0 — black screen
1 — mono (default)
2 — stereo
Last update: 2024-08-16
Build: ()