UKismetRenderingLibrary::ExportRenderTarget
#include "Kismet/KismetRenderingLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Exports a render target as an HDR or PNG image to disk, choosing the format automatically based on the render target's own pixel format.
Caveats & Gotchas
- • The output format (HDR vs PNG) is determined by the render target's format, not by the extension in FileName — passing a mismatched extension does not force a conversion.
- • This is a synchronous disk write; calling it on the game thread with a large render target can cause a noticeable hitch.
- • Works at runtime in packaged builds (unlike the EditorOnly conversion functions), but the destination path must be writable on the target platform — this is unreliable on consoles and mobile.
Signature
static void ExportRenderTarget(UObject* WorldContextObject, UTextureRenderTarget2D* TextureRenderTarget, const FString& FilePath, const FString& FileName); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | UObject* | Object used to resolve the current world. | — |
| TextureRenderTarget | UTextureRenderTarget2D* | The render target to export to disk. | — |
| FilePath | const FString& | Directory path to write the exported image into. | — |
| FileName | const FString& | File name (with extension) for the exported image. | — |
Return Type
void Example
Save a captured render target to disk C++
UKismetRenderingLibrary::ExportRenderTarget(this, CaptureRT, FPaths::ProjectSavedDir() / TEXT("Captures"), TEXT("Capture.png")); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?