RealDocs

UKismetRenderingLibrary::CreateRenderTarget2DArray

function Engine Blueprint Since 5.0
#include "Kismet/KismetRenderingLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Creates a new 2D render target array with the given number of slices and initializes it to the specified dimensions.

Caveats & Gotchas

  • Not every RHI/platform supports render target arrays; check hardware support before relying on this in a shipping title targeting lower-end platforms.
  • Memory scales linearly with Slices — a large array of high-resolution slices can exhaust GPU memory quickly.
  • As with CreateRenderTarget2D, the caller must hold a reference to the result or it is eligible for garbage collection.

Signature

static UTextureRenderTarget2DArray* CreateRenderTarget2DArray(UObject* WorldContextObject, int32 Width = 256, int32 Height = 256, int32 Slices = 1, ETextureRenderTargetFormat Format = RTF_RGBA16f, FLinearColor ClearColor = FLinearColor::Black, bool bAutoGenerateMipMaps = false, bool bSupportUAVs = false);

Parameters

Name Type Description Default
WorldContextObject UObject* Object used to resolve the current world.
Width int32 Width of each slice in pixels. 256
Height int32 Height of each slice in pixels. 256
Slices int32 Number of array slices to allocate. 1
Format ETextureRenderTargetFormat Pixel format of the render target array. RTF_RGBA16f
ClearColor FLinearColor Default clear color used when the target is cleared. FLinearColor::Black
bAutoGenerateMipMaps bool Whether mips are generated automatically after rendering. false
bSupportUAVs bool Whether the render target's resource supports unordered access views for compute shader writes. false

Return Type

UTextureRenderTarget2DArray*

Example

Create a 4-slice array C++
UTextureRenderTarget2DArray* RTArray = UKismetRenderingLibrary::CreateRenderTarget2DArray(this, 512, 512, 4, RTF_RGBA16f);

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.