How to Save SceneCapture RenderTarget as PNG or TGA

I am trying to export a SceneCapture to file.

I can sucessfully export to PNG as per the solution here: https://answers.unrealengine.com/questions/499570/exporting-a-rendertarget-as-a-png.html

Which works if I set the render target format to “RTF RGBA8”, and the scene capture source to “Final Color (LDR) in RGB”.

However instead of “Final Color (LDR) in RGB”, I want to export as “BaseColor in RGB”:

I followed the instructions here to create a SceneCapture2D and save to RenderTarget, and here is the Blueprint I created to save the RenderTarget to file:

This creates a PNG in the project directory, and as per the thumbnail image, this appears to be exactly what I want (i.e. RGB BaseColor only):

However, when I try to actually open the file, the image is blank:

The file exporting process seems to work for FinalColor:

  1. Capture Source: “Final Color (LDR) in RGB”
  2. Render Target Format: “RTF RGBA8”

…but not for BaseColor:

  1. Capture Source: “BaseColor in RGB”
  2. Render Target Format: “RTF RGBA8”

However I can’t see why this would make a difference.

I have tried using 4.26.2 and 5.0.0-16682836+++UE5+Release-5.0-EarlyAccess, but get the same problem. I’m wondering if this is a bug.

Has anyone managed to successfully export a BaseColor scene capture to file? If so, could you please share your solution?

2 years later, I have the same problem. I haven’t found a solution but I am answering just to revive the thred.

To save a SceneCapture RenderTarget as PNG or TGA in Unreal Engine, use the SceneCapture2D component to render the scene to a RenderTarget texture. Then, use the FImageUtils::ExportRenderTarget2DToDisk function, specifying the desired file format (PNG or TGA). Ensure the output file path is valid, and the image is saved using IFileManager or similar tools. This allows automated saving of the rendered image during runtime.

1 Like

I tried it, but the alpha channel of the image is 0 and all pixels are transparent. Just write a C++function to set the alpha channel to 1 when exporting the image. There is a lot of related information on the forum