Oculus Rift Dev: Day #1

Good news! Yesterday I received a mail from the Oculus guys and it seems my Oculus Rift is on its way!

In the meantime I'm reading the documentation and taking some notes, just to highlight the most important points I've found in the  Oculus Developer Guide.

LibOVR integration:

  • Initialize LibOVR.
  • Enumerate Oculus devices, create the ovrHmd object, and configure tracking.
  • Integrate head-tracking into your application’s view and movement code. This involves:
  1. Reading data from the Rift sensors through ovrHmd_GetTrackingState, ovrHmd_GetHmdPosePerEye, or ovrHmd_GetEyePoses. (so this stuff gets track of the eyes position? interesting...)
  2. Applying Rift orientation and position to the camera view, while combining it with other application controls.
  3. Modifying movement and game play to consider head orientation.
  • Initialize rendering for the HMD.


  1. Select rendering parameters such as resolution and field of view based on HMD capabilities.
  2. For SDK rendered distortion, configure rendering based on system rendering API pointers and viewports.
  3. or, for client rendered distortion, create the necessary distortion mesh and shader resources.


  • Modify application frame rendering to integrate HMD support and proper frame timing:


  1. Make sure your engine supports multiple rendering views.
  2. Add frame timing logic into the render loop to ensure that motion prediction and timewarp work correctly.
  3. Render each eye’s view to intermediate render targets.
  4. Apply distortion correction to render target views to correct for the optical characteristics of the lenses (only necessary for client rendered distortion).


  • Customize UI screens to work well inside of the headset
Initialization


// Include the OculusVR SDK
#include "OVR_CAPI.h"
void Initialization()
{
     ovr_Initialize();
     ovrHmd hmd = ovrHmd_Create(0); // from 0 to the value returned by ovrHmd_Detect
     if (hmd)
     {
           // Get more details about the HMD.
           ovrSizei resolution = hmd->Resolution;
           ...
     }
     // Do something with the HMD.
     ....
     ovrHmd_Destroy(hmd);
     ovr_Shutdown();
}
The ovrHmd handle is actually a pointer to an ovrHmdDesc struct that contains information about the
HMD and its capabilities, and is used to set up rendering. It includes info for version numbers, frustum, fov, near, far, distorsion, tracking, resolution, ...


Comentarios

Entradas populares