Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Overview

For those developers using the OSVR open source platform then CRYENGINE can be setup so that the OSVR SDK is used and an HMD connects to CRYENGINE.

Chapters:

Table of Contents
maxLevel2
minLevel2
excludeOverview

OSVR and CRYENGINE

OSVR requires an OSVR Server to be running in order for CRYENGINE to connect to the HMD. The easiest way to acquire the server and to test it is to download and install the OSVR Render Manager from here.

After installation, the Render Manager adds a series of shortcuts to the start menu. Click the OSVR Server shortcut to start the server.

Pay attention to what the server prints. It should report that it has found your HMD device. If not, check that you have plugged in the HMD correctly.

Next, verify that directmode works; use the D3D Example that comes with the Render Manager. If the example fails to start and closes without showing anything on the screen, then this means that directmode didn’t work correctly. Refer to the readme.txt provided with the Render Manager to check what driver version etc. is required.

Once the Server is running and you have verified that directmode works you are all set to use the OSVR with CRYENGINE.

NOTE: The OSVR server can also be run without directmode. Just select the non-directmode config and start the server. This will create a separate window to show the HMD output, but you can still use the HMD to change head orientation etc.

Starting the Engine with the Headset Enabled 

  1. Connect the device to your computer
  2. Make sure the vendor runtime/application recognizes your headset as ready for use
  3. Enable the OpenVR plugin by adding the following line to the plugin section of your .cryproject file

    Code Block
    { "type": "EPluginType::Native", "path": "CryOpenVR" },


    Warning

    If this line is added to the end of the .cryproject file’s plugin section, the comma at the end of the line should be omitted. If not, a parsing error will be generated when launching the project file.


  4. To the system.cfg or user.cfg file of your project, add the following lines:

    Code Block
    sys_vr_support=1
    hmd_tracking_origin=21


    Info

    The hmd_tracking_origin CVar sets the HMD's tracking origin point to:

    • The actor's feet, when its value is 0;
    • The camera (actor's head), when its value is 1.


  5. Launch the Engine (as admin).
Info

If sys_vr_support is set to 1, Sandbox will always launch with Stereo Mode and Stereo Output set to Dual Rendering and VR Headset respectively. This, however, can be changed/switched off at any point of time

Once launched, the Engine should be rendering to your head-mounted device. To edit your level:

  1. Click the  button at the top of the Sandbox Editor’s Viewport to bring up the display options.
  2. Scroll down to the Stereo Settings section, and set the Stereo Mode to No Stereo Output.

    No Stereo Output

Note
  • The No Stereo Output Stereo Mode overrides the Stereo Output setting, even if the latter is set to VR Headset.
  • Launch the Engine as admin if you encounter error 308.

Note
title308 admin error

Launch the Engine as admin if you encounter error 308