Exporting a renderTarget as a PNG?

But the Targets are created at runtime, so this isn’t an option :frowning:

Hello there!
My game makes a extensive use of render target textures, and I’d like to export them as PNG or other format. The ‘export’ node only allows for the HDR format, which isn’t very useful for most programs. The render targets are created at runtime.

Thanks in advance!

Hi.

  • In the settings of your
    RenderTextureTarget2D, uncheck HDR
    checkbox and save the asset.

  • In the content browser, right click
    your RenderTextureTarget2D asset and
    select Create Static Texture.
  • In the content browser, right click
    your newly created Texture2D asset
    and select Asset Actions->Export…

Now you should be able to choose from a selection of common LDR formats to save the file.


If this helped, don’t forget to upvote the answer and mark your question as resolved.

This is probably programming question then and you are likely to get faster response in programming section, or blueprint section.

You could try casting Render Target to Texture 2D in bluerptins, but not sure if it is possible.

You might as well describe what exactly are you trying to achieve by writing your render targets to files at run time. There might be more elegant solution.

As of UE4.24 if you want to save it as a TGA file, you simply have to change the Render Target Format to RTF RGBA8 and save. Then you can right click on the Render Target and choose “Create Static Texture” and you’ll be able to export that static texture as a TGA file.

I managed a PNG. I took the node “Export Render Target”. Set the Render Target to “RTF RGBA8” and set the Camera (Scene Capture 2D) to “Final Color (LDR) in RGB”.

5 Likes

Hi, i tried doing this but i could not find the PNG in the path i’ve mentioned!
is there anything im doing wrong? can you please help



I now use my own plugin for this. For UE5 I had to make additional settings. Here is a link to the documentation. There you can see the settings. Maybe that will help.

https://www.virtualbird.de/ue4Doku/RealTimeImport/rendertarget.jsp