How to ask GameThread to wait for Rendering thread, Screenshot function produces incorrect image

Hi,

I am writing a program to set actor location, rotation, then do a screen capture.

If I do a screen capture immediately after setting the location and rotation of my actor, I will get a low-quality image. As shown below.

0091.png

But if I wait for one second, then do the screen capture, I can get a much nicer image.

6.png

The difference between these two images can easily be observed in the pictures on the wall and the boundary of the couch.

I think the reason is because something is still in progress if I immediately ask a screenshot after setting the rotation and location.

In this document Threaded Rendering, it is said that FlushRenderingCommands can ask GameThread to wait for Rendering thread. I tried to add this function before taking a screenshot, but it can not work.

Anyone has experience of this issue? Thanks.

This is likely because post-process hasn’t been run at this stage. I’m not sure if there’s a way around that to be honest, because it has to run after all the GBuffers have been filled.