This page has been translated automatically.
Video Tutorials
How To
Professional (SIM)
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Light Sources
World Nodes
Sound Objects
Pathfinding Objects
Setting Up Development Environment
Usage Examples
UUSL (Unified UNIGINE Shader Language)
File Formats
Materials and Shaders
Rebuilding the Engine Tools
Double Precision Coordinates
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
Content Creation
Content Optimization
Material Nodes Library
Art Samples
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Oculus Rift Output with Oculus Plugin

The Oculus plugin is used to support the Oculus Rift head-mounted display. For the correct work of the plugin Oculus Rift PC Runtime is required. Note that your customers must have runtime installed as well. The plugin supports all HMD types supported by the latest Oculus Rift PC Runtime (including Oculus Rift CV1 (Consumer Version).

Since Oculus VR has stopped supporting Linux, the plugin is available only for Windows.

The Oculus plugin provides the VR mode that allows for rendering to both the Oculus Rift head-mounted display and the PC display. When the VR mode is disabled, the image is rendered only to the PC display. The mode can be toggled by using the engine.oculus.setEnabled() function.

Both the windowed and the full screen modes are supported. On the PC display the image is rendered as follows:

Valley benchmark rendered on PC display with Oculus

See Also#

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

Implementing Unigine Application with Oculus Support#

To use the Oculus Rift virtual display with Unigine, perform the following:

  1. Get and set up the latest Oculus Rift PC Runtime.
  2. Create a new project with Oculus support via UNIGINE SDK Browser: click Video Output Options, check the Oculus support (Oculus plugin) option in the form that opens and click OK.
    To add Oculus support to an existing project, in UNIGINE SDK Browser, click Other Actions -> Configure Project -> Video Output Options -> Oculus support (Oculus plugin) -> Ok.

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

Launching Oculus#

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

Shell commands
main_x64.exe -extern_plugin "Oculus"

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

Head-tracking support is available by default.

Oculus Options#

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

  • oculus_density - the render target pixel density. In other words, this is the ratio of the number of render target pixels to display pixels at the center of distortion. The default value is 1.0 (the render target pixel density matches the display surface at the point on the display).
  • oculus_scale - the world scale. The default value is 1.0.
Shell commands
main_x64d -extern_plugin "Oculus" -oculus_density 1.0 -oculus_scale 8.0

Console Commands#

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

Name Description Arguments
  • Command. Sets the viewport mode.
  • Variable. Prints the value specifying which viewport mode is set.
0 — black screen
1 — mono (default)
2 — stereo (images sent to VR device)
3 — stereo final (images with additional VR device distortions, etc.)
Last update: 2023-08-08
Build: ()