RealDocs

UKismetRenderingLibrary::ReadRenderTargetRawPixel

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

Description

Reads a single pixel from a render target as-is (no sRGB conversion) at an integer pixel coordinate, returning the raw linear value.

Caveats & Gotchas

  • Incredibly inefficient and slow — this stalls the render thread to read back GPU memory one pixel at a time. Never call in a loop or per-frame on anything performance sensitive.
  • Unlike ReadRenderTargetPixel, this does not assume sRGB space for LDR targets — it returns the raw stored value, which matters for HDR/linear formats like RTF_RGBA16f.
  • bNormalize only affects normalized 8-bit formats; it has no effect on floating point render target formats.

Signature

static FLinearColor ReadRenderTargetRawPixel(UObject* WorldContextObject, UTextureRenderTarget2D* TextureRenderTarget, int32 X, int32 Y, bool bNormalize = true)

Parameters

Name Type Description Default
WorldContextObject UObject* World context used to resolve the current world.
TextureRenderTarget UTextureRenderTarget2D* The render target to read from.
X int32 Integer pixel X coordinate to sample.
Y int32 Integer pixel Y coordinate to sample.
bNormalize bool Whether to normalize 8-bit formats into the [0,1] range. true

Return Type

FLinearColor

Example

Sample a raw pixel value C++
FLinearColor RawValue = UKismetRenderingLibrary::ReadRenderTargetRawPixel(this, HeightmapRT, 128, 128);
float Height = RawValue.R;

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.