How can I save a RenderTarget or a Texture to a file?
I've seen this question asked in a few different ways, but no one seems to be able to give a definitive answer.
To sum up, I'm using a SceneCaptureComponent2D to render to a RenderTarget. I want to save that RenderTarget to disk, at runtime. Everything with this is working fine, I just don't know how to do the last step of saving it to a file.
To be more explicit on what I'm trying to create, we have a literal camera in our game that the player can use to take pictures. We want to save these pictures to disk so that the player can share them.
A solution in Blueprint is preferred, but C++ is not a problem.
asked Nov 13 '15 at 06:10 PM in Rendering
I wasn't able to find anything built in, so I ended up writing something myself. I'm relying on FHighResScreenshotConfig, as it already does most of the work. You could probably dig into it if you need more control.
The loop to set the alpha was a bit of a hack fix. For some reason, the alpha isn't set correctly on the render target, so you need to manually set it before saving.
answered Jan 11 '16 at 03:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here