2D Layer
- Last UpdatedApr 28, 2023
- 1 minute read
2D Layer
The following layer type can render 2D contents on top of another layer:
-
2DOverlay Renderer (type is 2dOverlay)
Input
-
The input1 parameter is the background Layer where the 2D Layer renders on top of.
-
If input1 is not specified, then the 2D Layer renders on top of a black background.
Camera
-
The camera is required only to render 2DLabels.
-
The extra camera is required when making stereo rendering without using code paths (such as Oculus or OpenVR) that automatically handle the camera. For example, during a DualHead viewport rendering, the extra camera is used as the Mono Camera. This is the camera from which the Stereo Cameras are derived.
-
If the extra camera is required but not specified, the camera value is used.
Code example
This is an example of 2DOverlay renderer that uses a 2DLayer created inside the code.
<Layer name="SomeName" type="2dOverlay">
<layer2DName value="MainLayer"/>
<!-- name of the 2DLayer created by the code (note that the <Layer> node and the "code 2DLayer" are different things) -->
<input1 value="SourceLayerName"/>
<!-- some Layers need an input in order to be rendered, in this case the input is the name of another Layer -->
<cameraName value="Camera001"/>
<!-- it's not mandatory, can be also specified by the code -->
<extraCameraName value="Camera001"/> <!-- it's not mandatory, can be also specified by the code -->
</Layer>