Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/FRenderTarget
Description
Reads the render target's displayed pixels into a preallocated color buffer. This will convert whatever the pixel format is to FColor Prefer using FImageUtils::GetRenderTargetImage rather than calling this directly.
The default value for InFlags specifies RCM_UNorm which will cause values to be scaled into [0,1] ; use RCM_MinMax to retrieve values without change.
If the RenderTarget surface is float linear, it will converted to SRGB FColor, if InFlags.bLinearToGamma is set (which is on by default). If the RenderTarget surface is U8, then the SRGB/not state is unchanged, the U8 values are retrieved unchanged in either Linear or SRGB. Gamma is handled correctly automatically by FImageUtils::GetRenderTargetImage
Derived Overrides
- FTextureRenderTarget2DArrayResource::ReadPixels
- FTextureRenderTargetCubeResource::ReadPixels
- FTextureRenderTargetVolumeResource::ReadPixels
| Name | ReadPixels |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Public/UnrealClient.h |
| Include Path | #include "UnrealClient.h" |
| Source | /Engine/Source/Runtime/Engine/Private/UnrealClient.cpp |
virtual bool ReadPixels
(
TArray < FColor > & OutImageData,
FReadSurfaceDataFlags InFlags,
FIntRect InSrcRect
)
True if the read succeeded.
Parameters
| Name | Remarks |
|---|---|
| OutImageData | RGBA8 values will be stored in this buffer |
| InFlags | Additional information about how to to read the surface data (cube face, slice index, etc.) |
| InSrcRect | InSrcRect not specified means the whole rect |