DEVICE-CENTRIC DOCUMENTATION

The site has a new content architecture. We've added the ability to select your development device to show device-specific content. Please read our blog post Oculus Developer Center Update: Device-centric Documentation Architecture for more information.

Oculus Quest Development

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible. For additional information and context, please see Submitting Your App to the Oculus Quest Store.

Oculus Dash, Overlays and Input Focus

This guide describes how to add overlay support to Unreal applications for Oculus Quest apps and Oculus Dash support to Unreal applications for Oculus Rift.

Overlays are a feature that enables Oculus system interface, such as Oculus Dash or the Universal Menu, to appear over an application without requiring the application to be paused. This enables users to access system features such as social menus, settings and more.

Oculus Dash is a central hub containing Oculus system UI, and it runs on Rift devices as an overlay inside your current VR experience. This enables users to quickly switch from one application to the next, open their library and connect with friends without any extra steps. For general information about Dash, see the Dash announcement: Introducing Rift Core 2.0—Our Biggest Software Update Yet!. Also see the Introducing Oculus Dash video to get a sense of how Dash works.

For overlays to display properly, an application must be input-focus aware.

When users pause an application, one of two things will happen:

  • If the application is focus aware and has overlay support, the application will pause and the system UI will be drawn over the paused application.
  • If the application is not focus aware and does not have overlay support, the application will be paused by the runtime and the user will be presented with the system UI in an empty room.

Overlay and Oculus Dash Support in Unreal

The Oculus Unreal integration provides the following support:

  • The ability to configure whether the application is input focus aware
  • Input focus handling
  • For Rift, you can also configure the depth buffer support

Declare an Application is Input Focus Aware

You can declare that your application is input focus aware by doing the following:

For Rift, under Edit / Project Settings / Plugins / OculusVR / PC , check Supports Dash.

When your application supports Dash, the Dash menu will be drawn over your paused application instead of in an empty room.

Alternatively, you can launch the application with the parameter -oculus-focus-aware. This will indicate that your application is Dash aware during that invocation of the application.

Do not specify that your application supports Dash unless it properly handles input focus loss.

Note: You can enable this feature, but it is only available for testing to approved Oculus Quest developers.

You must have Oculus OVRPlugin v13 or later.

To enable overlays, go to Edit > Project Settings > Plugins > Oculus VR > Mobile, and check Focus Aware

Input Focus Handling

When an overlay appears (such as when the user presses the Oculus button), the running application loses input focus and the HasInputFocus flag will return false. An application regains input focus when the overlay is dismissed. The runtime renders tracked controllers in the scene to interact with the menu.

Input focus status may be queried using a Blueprint or in code. This query should be performed once during every frame render cycle.

Use OculusLibrary::HasInputFocus to query input status using Blueprints.

To query input focus status in C++, use code similar to the following:

ovrpBool HasFocus = ovrpBool_False;
if (OVRP_SUCCESS(ovrp_GetAppHasInputFocus(&HasFocus)))
   {
   return HasFocus == ovrpBool_True;
   }
else
   {
   return false;
   }

Ensure that your app takes the appropriate action when input focus is lost. Examples may include:

  • Pausing gameplay. When you do this, it is important to remember that the system will display its own UI on top of any UI your app displays, and your app cannot accept input because it doesn’t have input focus.
  • Hide the user’s input affordance such as arms or hands
  • For online/multiplayer games, indicate the user isn’t focused on the app.

Following is an illustration of a typical implementation of hiding tracked controllers when input focus is lost from the VRCharacter Blueprint in the Touch sample.

Depth Buffer Support

By default, Dash-compatible Unreal versions automatically submit depth information for scene geometry to help avoid depth conflicts between the Dash UI rendered in the scene and objects in the scene. It also enables compositor layer depth testing.

You can disable depth buffer support. We do not recommend doing so, unless you have a good reason. There are two ways you can do this.

  • Uncheck Composites Depth under Edit / Project Settings / Plugins / OculusVR / PC.