Add a new Render Target
Add Render Target
A render target is an abstraction of a rendering surface. In the field of 3D computer graphics, it is a feature of modern graphics processing units (GPUs) that allows a 3D scene to be rendered to an intermediate memory buffer, or Render Target Texture (RTT). It can then be manipulated by shaders in order to apply additional effects to the final image before displaying it.
As mentioned before, there are two types of render targets:
- Display Render Targets: They address the rendering in a native surface of the graphic device.
- Texture Render Targets: They represent textures which can be used in the scene to render into them.
A new render target can be added using one of the following possibilities:
Go to "Platform" > "New Render Target" in the menu bar or go to the Render Targets panel, right click on a node under the display and select "New Render Target" from the context menu.

Set the following items in the Add New Render Target dialog box and click [ OK ] to create a new Render Target.

| Item | Description |
| Top input field | The location where the Render Target is saved in Solution Explorer |
| Name | The Render Target Name |
| Description | The Render Target Description |
| Annotations | The Render Target Annotations |
| URI | The Render Target URI |
| Export Always | If enabled, the Render Target selected at the time of asset generation is always exported to the asset. |
| Render Target Template | The Render Target template |
| Display | The display that is linked to the Render Target |
The types available depend on the SceneComposer platform of a given solution, respectively of the feature set of the Candera Device specified by the platform.
The newly added render target can have the properties listed in the table below set in the Properties panel. The properties of the display render targets "Width", "Height" and "X", "Y" coordinates have to be configured with appropriate values that can be changed via Properties panel. The displays and the display render targets associated can be seen in the Render targets panel.
| Section | Property name | Description |
| Render Target |
Render Target Template |
The Render Target template Select the Render Target template from the following:
For details, please refer to Cameras and Render Targets. |
|
Display |
The display that is linked to the Render Target |
|
| Owner | The texture that is linked to the Render Target | |
| Type | The Render Target type | |
| Auto Swap | If enabled, the buffer will be automatically swapped (switched to new drawing) once all cameras linked to the Render Target have completed drawing. | |
| Auto Clear |
If enabled, the relevant buffers (color, depth, and stencil buffers) are automatically cleared before a rendering operation to a Render Target is performed. The depth buffer is cleared with "1, 0" values. |
|
| Is Default |
If enabled, it will be set as the default Render Target. For details, please refer to Default Render Target. |
|
| Orientation |
Rotation angle of the rendered image (0°/90°/180°/270°) For details, please refer to Rotate Display Preview. |
|
| ClearMode |
A ClearMode item used to clear the buffer associated with a 3D Render Target. For instructions on how to create a ClearMode item, see ClearMode. |
|
| ClearMode2D | Color to clear the color buffer of a 2D Render Target | |
| Edting Utilities |
Preview Border Scope |
Preview borders for the targeted Render Target Available in Global Preferences.
|
| Preview Border Color |
Preview border color for the target Render Target Available in Global Preferences. |
|
| Width | Render target width (horizontal pixels) | |
| Height | Render target height (vertical pixels) | |
| X | The position of the Render Target along the X axis (horizontal direction) in the display linked to the Render Target | |
| Y | The position of the Render Target along the Y axis (vertical direction) in the display linked to the Render Target | |
| Layer |
Window Surface Layer ID When there are multiple render targets, you can set the rendering order. The number of layers supported varies by device. Also, Window Surfaces with the same layer ID cannot be uploaded at the same time. For details, please refer to Multiple Render Targets. |
|
| BlendMode |
Blend mode
|
|
| AntiAliasingSampleBuffers | Number of sample buffers to use for anti-aliasing | |
| AntiAliasingMultiSamplingFactor | Minimum number of samples to use for multi-sample buffers used for anti-aliasing | |
| MaxSwapInterval |
Maximum swap interval Set when using EGL settings. If this value is "-1", the maximum swap interval is not limited. |
|
| MinSwapInterval |
Minimum swap interval Set when using EGL settings. If this value is "-1", the minimum swap interval is not limited. |
|
| SwapInterval |
Swap Interval Applies to the Window Surface. The initial value is "1". If the value is "0", the buffer swap is not synchronized with the video frame, and the swap is performed as soon as rendering is completed. If the value is "1" or more, the buffer swap is performed every time the vertical synchronization signal (V-sync) is received the number of times specified by the value. |
|
| RedSize | The number of bits for the Red color in the color buffer. | |
| GreenSize |
The number of bits for the Green color in the color buffer. |
|
| BlueSize | The number of bits for the Blue color in the color buffer. | |
| AlphaSize | The number of bits for the Alpha in the color buffer. | |
| Conformat | Set this property to enabled if Render Target is OpenGL ES compliant. | |
| DepthSize |
Number of bits in the depth buffer |
|
| StencilSize | Number of bits in the stencil buffer | |
| BufferPreservedBit | If enabled, Render Target contents are preserved after buffer swapping, potentially improving performance by reducing GPU strain when only a portion of the screen changes. |
Please refer to the Candera API Documentation to learn about device-specific render target properties:
Candera::RenderTarget
Every new created render target could be enabled or disabled by ticking the checkbox. When deactivating/activating a render target by unchecking/checking the checkbox, the render target gets also unloaded/uploaded. Therefore, one can make use of several WindowSurfaceRenderTarget objects having the same layer by activating only one of them; the others will not be uploaded.

A render target can be deleted using the context menu option "Delete" in the Render Targets panel.
Configure Render Target
Configure a Display Render Target
In the "Render Targets" panel, the Display Render Targets are organized in the DisplayRenderTargets collection of a Display node.
New display render targets will be listed under this category.
Configure a Texture Render Target
Rendering to a texture is simple on one hand, but on the other hand it is powerful and enables numerous special effects. It is an extension to rendering to a surface.
Usually, for a texture render target, the texture render target properties "Width" and "Height" must be configured according to the required size of the texture.
To use a texture render target as a texture, SceneComposer allows selecting a texture render target in the "Choose Item" dialogs, whenever a texture shall be selected during composing a scene.

Clear Mode Item
The "Clear Mode" item can be created via "Solution Explorer" panel by using the context menu option ("Add" > "New Item"). In this way, all its specific properties ("Clear Color", "Enable Color Write", "Enable Depth Clear" and "Enable Stencil Clear") are related with just one item instead of being included among many other properties of every render target. If there are many render targets which are referencing the same clear mode item, it is enough to modify just one time the desired property rather than modifying every of them.

After the creation of a "Clear Mode" item, it can be used after being referenced from a specific Render Target. This operation can be done by using the "Clear Mode" property available in the "Properties" panel associated with any available render target.

If a ClearMode is a associated to a RenderTarget, the RenderTarget is cleared using that clearmode before any of the attached cameras renders to it.
Clear Mode Property
See also: Candera::ClearMode