RealDocs

UKismetRenderingLibrary::ResizeRenderTarget2D

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

Description

Changes the resolution of an existing render target, useful when the game viewport size or in-game resolution changes at runtime.

Caveats & Gotchas

  • Resizing reallocates the underlying GPU resource, discarding any previously rendered contents — clear or redraw the target afterward.
  • Calling this every frame (e.g. to match a constantly-changing size) is wasteful; only call it when the target size actually needs to change.
  • If Width or Height matches the current size, the engine still performs the update path rather than skipping it, so avoid calling it redundantly in a loop.

Signature

static void ResizeRenderTarget2D(UTextureRenderTarget2D* TextureRenderTarget, int32 Width = 256, int32 Height = 256);

Parameters

Name Type Description Default
TextureRenderTarget UTextureRenderTarget2D* The render target to resize.
Width int32 New width in pixels. 256
Height int32 New height in pixels. 256

Return Type

void

Example

Match viewport resolution C++
UKismetRenderingLibrary::ResizeRenderTarget2D(SceneCaptureRT, NewViewportWidth, NewViewportHeight);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.