This guide covers how to implement compositor layers in your Unreal application. For additional information, see Compositor Layers.
Overview
In Unreal, compositor layers are implemented through the Stereo Layer API. Note that the Stereo Layer API is only supported for Meta Quest headsets on Unreal Engine 5.
By default, compositor layers are always displayed on top of all other objects in the scene. You may set compositor layers to respect depth, causing them to be occluded by scene elements that are closer to the camera, 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 higher values indicating greater priority (e.g., 1 renders on top of 0).
You may add up to 16 compositor layers to Meta Quest applications. Any additional layers beyond this limit will not be rendered.
Note that enabling Supports Depth may affect performance, so use it with caution and be sure to assess its impact.
Samples
To see examples of compositor layers in Unreal, check out the following:
Layer Sample for a basic illustration of using UMG on quad layers and cylinder layers.
Phanto for use of a compositor layer as a game round pop-up.
Creating a Compositor Layer
To create a compositor layer:
Create an Actor and add it to the level.
Select the Actor, select Add Component, and choose Stereo Layer.
Under the Stereo Layer options, set Stereo Layer Shape to Quad Layer, Cylinder Layer, or Equirect Layer.
Set Stereo Layer Type to Face Locked, Tracker Locked, or World Locked.
Set the overlay dimensions in world units in Quad Stereo Layer Properties or Cylinder Stereo Layer Properties.
Select Supports Depth in Stereo Layer to set your compositor layer to not always appear on top of other scene geometry. Note that this may affect performance.
Set Texture to the texture that should be rendered as a compositor layer. Adjust the size of your compositor layer using the shape-specific properties: Quad Size for quad layers, or the dimension settings within Quad Stereo Layer Properties or Cylinder Stereo Layer Properties for other shapes.
To connect the compositor layer to a UMG UI widget:
Create a Widget Blueprint and modify it to include your desired UI elements.
On the same Actor that contains the Stereo Layer, select Add Component, and choose Widget.
To ensure the widget aligns visually with the compositor layer, adjust Widget Draw Size and Pivot to match the Stereo Layer’s Quad Size.
Disable Render in Main Pass for the widget. The widget will be rendered by the Stereo Layer component instead.
Add logic like the following Blueprint, which updates the Stereo Layer with the texture of the widget, to your Actor containing the Widget and Stereo Layer components: