Skip to content

oculus-samples/Unreal-LayerSample

Repository files navigation

LayerSample Banner

Compositor Layer Sample

This sample provides blueprints illustrating the use of VR compositor layers to display Unreal Motion Graphics UI widgets.

The app displays a UMG UI widget that can be toggled between rendering as a compositor layer using Unreal's StereoLayer API, and rendering in Unreal's main pass. Additionally, it showcases some of the non-quad shapes available for compositor layers.

Interact with the scene by pointing with your right Touch controller, and pressing the right trigger to press buttons.

MenuActor illustrates rendering a widget into a stereo layer. In its Tick event, the Render Target of its Menu widget is set as the texture of the stereo layer. Its OnToggleClicked_Event shows how to disable Widget in-scene rendering, which is recommended since the stereo layer will display the Widget to the user.

How to Use

Load the project

First, ensure you have Git LFS installed by running this command:

git lfs install

Then, clone this repo using the "Code" button above, or this command:

git clone https://github.com/oculus-samples/Unreal-LayerSample

Launch the project in the Unreal Editor using one of the following options.

Epic Games Launcher with MetaXR plugin

The easiest way to get started is to use the prebuilt Unreal Engine from the Epic Games Launcher, with MetaXR plugin.

  1. Install the Epic Games Launcher
  2. In the launcher, install UE5 (recommended).
  3. Download and install the MetaXR plugin from the Unreal Engine 5 Integration download page.
  4. Launch the Unreal Editor
  5. From "Recent Projects", click "Browse" and select LayerSample.uproject

Meta fork of Epic’s Unreal Engine

The Meta fork of Epic’s Unreal Engine will give you the most up to date integration of Oculus features. However, you must build the editor from its source.

Follow the instructions on Accessing Unreal Engine source code on GitHub to obtain:

  • an Epic account
  • a GitHub account
  • authorization to access the Unreal Engine source repository Disregard instructions on downloading Epic’s Unreal Engine source code as you will be building the Meta fork of Epic’s Unreal Engine source.

Make sure you have Visual Studio installed properly:

  • Launch the Visual Studio Installer and click Modify for the Visual Studio version you want to use.
  • Under the Workloads tab, click Game development with C++ if it isn’t checked and then click Modify.
  1. Download the source code from the Meta fork of Epic’s Unreal Engine on GitHub.
  2. Follow Epic’s instructions on Building Unreal Engine from Source to complete the process.
  3. Launch the Unreal Editor
  4. From "Recent Projects", click "Browse" and select LayerSample.uproject

Depending on your machine, the build may take awhile to complete.

Licenses

The Meta License applies to the SDK and supporting material. The MIT License applies to only certain, clearly marked documents. If an individual file does not indicate which license it is subject to, then the Meta License applies.

About

This sample provides blueprints illustrating the use of VR compositor layers to display a UMG UI widgets. The Oculus SDK and other supporting material is subject to the Oculus proprietary license.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors