Screenshot at runtime without stutter

Bump, anyone please?

Since the last time I have also tried using a single scene capture component (since previously it was spawned with an custom scene capture actor and then destroyed) and calling CaptureSceneDeferred(), but unfortunately it still doesn’t help.

Right now, the code looks like this:

textureRenderTarget->InitCustomFormat(resolution.X, resolution.Y, PF_B8G8R8A8, false);

SceneCaptureComponent->TextureTarget = textureRenderTarget;
SceneCaptureComponent->CaptureSource = ESceneCaptureSource::SCS_FinalColorLDR;
SceneCaptureComponent->CaptureScene(); // Or deferred

TArray<FColor> colorData;
colorData.Reserve(resolution.X * resolution.Y);

textureRenderTarget->GameThread_GetRenderTargetResource()->ReadPixels(colorData); // Or custom enqueue render command going straight for GDynamicRHI->RHIReadSurfaceData
2 Likes