Take screenshot using render target

I am trying to recreate the behaviour of the ‘shot’ or ‘highresshot’ console commands in order to take a screenshot of the viewport. I was using these commands previously, however I found that they weren’t working in the packaged version of the game (I tried using both the console command blueprint node and the equivalent in CPP, neither worked). Regardless, I never really liked using console commands to achieve this.

In my level map, I have two light sources: a directional light and a sky light. I also have a GlobalPostProcessVolume. I have added a SceneCapture2D actor to the map, keeping all settings to default except for changing Capture Source and preventing it from capturing every frame.

I have the following blueprint logic:

This produces the following screenshot:

However, this differs from what is shown in the viewport. If I use the ‘shot’ command, I get this:

Firstly, while the camera location and rotation seem fine the FOV is slightly too low. More importantly, the light rendering seems completely different - the screenshot generated from the blueprint seems to have no self-casting shadows, and no reflected light cast on the walls.

I’ve tried every combination of SceneCapture2D capture source, and Render Target format, and this combination I’ve shown gives the “best” result.

What am I doing wrong here? Is it best to achieve this in a different way? (I am not tied down to this method by any means)

Barked up this tree before. With good results.

The settings on the scene capture was all that needed to be fixed up at the time to get nice shots.

Now, With Lumen and all the new BS, I doubt you can get good results. Unless you turn all of the things off and setup up the right light in the scens.

However they may have parameters you can toggle added to the scene capture to try and better match up the scene…

scene capture has it’s own post process settings. you gotta enable the features you need in there.