RealDocs

UKismetRenderingLibrary::ReadRenderTargetUV

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

Description

Reads a single pixel from a render target using normalized UV [0,1]x[0,1] coordinates, returning it as an 8-bit sRGB FColor.

Caveats & Gotchas

  • Same performance warning as ReadRenderTargetPixel — this is described as "incredibly inefficient and slow" in the engine source; avoid calling it per-frame.
  • U and V are not clamped for you before use; passing values outside [0,1] samples outside the target's bounds and produces undefined results.
  • As with the pixel-coordinate variant, LDR targets are treated as sRGB and HDR targets as linear before conversion to the returned sRGB FColor.

Signature

static FColor ReadRenderTargetUV(UObject* WorldContextObject, UTextureRenderTarget2D* TextureRenderTarget, float U, float V);

Parameters

Name Type Description Default
WorldContextObject UObject* Object used to resolve the current world.
TextureRenderTarget UTextureRenderTarget2D* The render target to sample from.
U float Normalized horizontal coordinate in the [0,1] range.
V float Normalized vertical coordinate in the [0,1] range.

Return Type

FColor

Example

Sample the center pixel by UV C++
FColor CenterColor = UKismetRenderingLibrary::ReadRenderTargetUV(this, HeightmapRT, 0.5f, 0.5f);

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.