This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
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 AppOculus Plugin

An AppOculus plugin is used to support the Oculus Rift head-mounted display. The following HMD types are supported:

  • Oculus Rift DK1
  • Oculus Rift HD prototype
  • Oculus Rift DK2

It can be rendered in both the windowed and the full screen mode.

Valley benchmark working in Oculus Rift mode

Notice
The HD mode is also supported.

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

  1. Plug in the Oculus Rift.
  2. Get and configure the Oculus Rift SDK or Oculus Runtime.
  3. Implement the application logic and launch the AppOculus plugin on the application start-up.

See Also

To run the plugin sample from the Unigine SDK Browser, press the AppOculus plugin button on the Plugin Samples tab.

Launching AppOculus

To launch the plugin, specify the extern_plugin command line option and STEREO_OCULUS define on the start-up:

Shell commands
main_x86d -extern_plugin "AppOculus" -extern_define STEREO_OCULUS
				
Notice
If the extern_define STEREO_OCULUS is not specified, a scene will be rendered incorrectly for the right eye.

Also you can create a new project with Oculus support by checking the Oculus support option on the New Project tab of the Unigine SDK Browser.

Head-tracking support is available by default.

AppOculus Options

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

  • oculus_device - ID of the connected device. The default value is 0.
  • 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_x86d -extern_plugin "AppOculus" -extern_define STEREO_OCULUS -oculus_device 0 -oculus_density 1.0 -oculus_scale 8.0
					

Plugin Compilation

Full Oculus SDK sources are required for the AppOculus plugin compilation:

  1. Get the Oculus Rift SDK
    Notice
    The 0.4.4 version is required.
  2. Set path to the <Oculus Rift SDK>/LibOVR folder in the OCULUSROOT environment variable:
    Shell commands
    OCULUSROOT=<Oculus Rift SDK>/LibOVR
    						
  3. Compile the plugin with the build script:
    Shell commands
    C:\UnigineSDK\utils>build.py --plugin AppOculus
    						
    You can also compile the plugin manually with Scons:
    • Go to the <UnigineSDK>\source\plugins\App\AppOculus via the command line
    • Type scons and press ENTER:
      Shell commands
      C:\UnigineSDK\source\plugins\App\AppOculus>scons
      								
Last update: 2017-07-03
Build: ()