With Unreal, you may add transparent or opaque quadrilateral, cubemap, or cylindrical overlays to your level as compositor layers.
Asynchronous TimeWarp compositor layers (such as world-locked overlays) are rendered at the same frame rate as the compositor, rather than rendering at the application frame rate. They are less prone to judder, and are raytraced through the lenses, which improves the clarity of textures displayed on them.
We recommend using compositor layers for text. Text rendered on compositor layers is more legible.
Gaze cursors and UIs are good candidates for rendering as quadrilateral compositor layers. Cylinders may be useful for smooth-curve UI interfaces. Cubemaps may be used for startup scenes or skyboxes.
We recommend using a cubemap compositor layer for your loading scene, so it will always display at a steady minimum frame rate, even if the application performs no updates whatsoever. This can significantly improve application startup times.
Quadrilateral, cylinder, and cubemap layers are supported in Unreal versions 4.13 and later.
By default, VR compositor layers are always displayed on top of all other objects in the scene. You may set compositor layers to respect depth positioning by enabling Supports Depth. If you are using multiple layers, use the Priority setting to control the depth order in which the layers will be displayed, with lower values indicating greater priority (e.g., 0 is before 1).
Note that enabling Supports Depth may affect performance, so use it with caution and be sure to assess its impact.
To create an overlay:
The Pawn you slave the component to will be fixed at the center of the quad or the cylinder.
You may add up to three VR compositor layers to mobile applications, and up to fifteen to Rift applications.
Select the Is External Surface checkbox to identify that the layer will be used to pass through textures/video from an external Android Surface.
This feature allows an Android Surface to be created and managed by the timewarp layer. In your project you can create a quad overlay and render the Surface texture directly to the TimeWarp layer. The Animated Loading Screen tech note contains a sample script that demonstrates how to do this in Native C++ applications.
The LayerSample, available from our Unreal GitHub repository, illustrates the use of VR Compositor Layers to display a UMG UI. For more information, see Unreal Samples.