Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syyama/1a1f855ed44f03e4cc87 to your computer and use it in GitHub Desktop.
Save syyama/1a1f855ed44f03e4cc87 to your computer and use it in GitHub Desktop.
Developing with Oculus: Mastering the Oculus SDK

###Developing with Oculus: Mastering the Oculus SDK

Volga Aksoy @ Oculus Michael Antonov @ Oculus

###Table of Contents

  • New SDK Features
    • Direct-to-Rift
    • Latency Testing & Dynamic Prediction in DK2
    • Pixel Luminance Overdrive

###Real-time Engine Integration Tips

  • SDK rendering vs. App rendering
  • Troubleshooting judder
  • FOV, texture resolution
  • Asymmetric / symmetric frustum issues
  • Left / right separate eyes vs one buffer
  • Multi-treading and timing

###Looking Into The Future

  • Time Warp Improvements
  • SDK Roadmap

###New SDK Features

  • Direct To Rift

###Extended Mode

  • Headset shows up as an OS Display
    • Application must place a windows on Rift monitor
    • Icon and Windows in a wrong place
    • Windows compositor handles Present
    • There is usually at least one extra frame of latency
    • More latency if no CPU & GPU sync is done

###Direct To Rift

  • Outputs to Rift without Display being a part of the desktop

    • Headset not seen by the OS
    • Avoid jumping windows and icons
    • Decouples Rift v-sync from OS compositor
    • Avoids extra GUP buffering for minimum latency
    • Use ovrHmd_AttachToWindow
    • Windows swap chain output is directed to the Rift
  • Hope to see Direct Mode become the longer term solution

###Direct To Rift - Mirroring

  • Direct to Rift Supports duplicating the image to a Window
  • Minimum overhead
  • Can be disabled by ovrHmdCap_NoMirrorToWindow
  • Possible to display a diffrent image instead, such as message in this screen

###Direct To Rift - Implementation

  • LibOVR shims Direct3D/GL Runtime
    • Must call ovr_InitializeRenderingShim() before D3D use
    • Windows Swap Chain has an associated Rift Primary Buffer
    • On DK2, back buffer is copied and rotated to Primary for display
    • For best quality, use reported resolution
  • User/Kernel Mode Video Driver Shim
    • Hides Rift from OS, allowing us to find and render to it
    • Allows flipping with Rift's v-sync (no composition queue)

###Direct To Rift - Challenges so Far (1/2)

  • symptom: "Rift doesn't on"
  • Optimus (NVidia + Intel HD GPU Laptops)
    • Discrete GPU not connected to HDMI port
    • SW has to create a bridge and copy data
    • Use NVidia driver bridge in Win 7/8; Win 8.1 cross adaptor support
    • Work on Razer Blade laptops
    • In some machines copy is slow (10ms + making it unusable)
  • Multi-GPU (SLI/Crossfire)
    • Rift plugged into the "wrong" adapter, need to copy

###Direct To Rift - Challenges so Far (1/2)

  • DisplayLink
    • Conflicting driver shim; working with Display Link to resolve.
    • Too slow for Rift output
  • Multi-Monitors
    • May sync to wrong Display => V-sync tear or Judder
    • Resolved with upcoming driver update
  • Other Software Shims
    • ASUS Splendid color, etc
    • Plan: Adding debugging logic, fix incrementally

###Direct To Rift - Future

  • Move Distortion/composition to a Separate Process
    • Remove Shims from the Application
    • Avoid state-related rendering issues
    • Support Time warp layer composition
    • Asynchronous Time Warp (TBD)
  • Multi-GPU TW rendering
    • Implementing Time warp on secondary GPU with Optimus
  • Researching better GPU pipelining / preemption

###New SDK Features

  • Latency Testing & Dynamic Prediction in DK2
  • Pixel Luminance Overdrive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment