CaptureComponent2D causes scene flicker

I have a setup where I use a minimap from one of the packages in the Marketplace. I added the scene capture component to the scene as described and cause a capture from above when the character moves. The result is that the rendered 3D scene flickers every time a capture is made for the minimap.

This bug was already reported in the past here link text and a related bug here link text

The first bug is marked as “solved” which it clearly is not. The flicker seems to happen only when the render target is of a certain size for instance 1024 * 1024. When I set the render target to 512*512 no flicker occurs.

Flickering is accompanied by constant outputs of the following sort to the logfile:

2017.04.02-23.46.00:411][407]LogRenderer: Reallocating scene render targets to support 1336x1024 NumSamples 1 (Frame:1409).
[2017.04.02-23.46.00:427][408]LogRenderer: Reallocating scene render targets to support 1336x836 NumSamples 1 (Frame:1411).
[2017.04.02-23.46.01:422][467]LogRenderer: Reallocating scene render targets to support 1336x1024 NumSamples 1 (Frame:1469).
[2017.04.02-23.46.01:437][467]LogRenderer: Reallocating scene render targets to support 1336x836 NumSamples 1 (Frame:1471).
[2017.04.02-23.46.02:437][527]LogRenderer: Reallocating scene render targets to support 1336x1024 NumSamples 1 (Frame:1530).
[2017.04.02-23.46.02:454][528]LogRenderer: Reallocating scene render targets to support 1336x836 NumSamples 1 (Frame:1532).

Hey Wallenstein,

So I would need a way to reproduce the first issue in a new blank project with minimal content (no minimap content). The first one dealt with the issue strictly on Windows 10, and was marked as resolved by me as the issue no longer occurred on that platform. If you can provide me with a test case to follow then we can investigate further.

Thank you,

Sorry I cant reproduce it in a new project. It happens only in my project but it’s a client app for a server connection and wont run alone, besides its over 7GB.

I would need a way to reproduce the issue in order to report this as a bug. Your issue could be the same as second bug you linked which is still unresolved.

Regards,

H

Hi Andrew,

I am seeing this bug as well. I’ve described it in a similar thread here. I believe you can reproduce it by doing the following:
Add a SceneCapture2D actor to the scene. Give it a render target whose resolution is larger than the PIE/Standalone window.
Periodically in your code, call ReadPixels doing something like this…

// camera is a SceneCaptureComponent2D*
UTextureRenderTarget2D* RenderTarget = camera->TextureTarget;
FTextureRenderTarget2DResource* RenderResource 
 = (FTextureRenderTarget2DResource*)RenderTarget->Resource;

TArray<FColor> pixels;
RenderResource->ReadPixels(pixels);

You should see the screen flicker every time ReadPixels is called as well as significant slowdown. The log should give the “re-allocating” message. Try this with bHDR both enabled and disabled on the texture target - I think there is a significant performance difference but you should see the bug either way.

I’m also seeing the re-allocation message when my texture targets are smaller than the current viewport, but I don’t get the screen flicker and I haven’t run the profiler yet to see if there is a significant performance cost in that case.

Having also the problem, like you described it depends on the Viewport- and SceneRenderTarget-Size. Also disabling Temporal-AA eliminates the flickering… I’m using 4.17.2 , has this been fixed in a later version?