I am working on an UE5 module that takes a high resolution and regular resolution screenshots each tick. I currently have a code that works for one screenshot with a given ResolutionWidth
and ResolutionHeight
. It takes AmountOfPicturesToTake
screenshots with a delta of ScreenshotIntervalSeconds
seconds between each screenshot:
void AScreenShotUtility::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (numberOfShots >= AmountOfPicturesToTake)
{
return;
}
// Take High res screenshot
CurrentTimeWithRespectToInterval -= DeltaTime;
if (CurrentTimeWithRespectToInterval <= 0.0f)
{
++numberOfShots;
GIsHighResScreenshot = true;
GScreenshotResolutionX = ResolutionWidth;
GScreenshotResolutionY = ResolutionHeight;
FScreenshotRequest::RequestScreenshot(true);
CurrentTimeWithRespectToInterval = ScreenshotIntervalSeconds;
}
}
I would like to be able to take two screenshots of the exact same frame at two resolutions. I tried using RenderTargets
and creating textures from it, but Textures only support base of 2 numbers for dimensions.
Is there a way I can take two screenshots at each tick in the same module instance, or would I need to create two instances that consider a different resolution? If I do so, am I insured that the captured frames will be the exact same ones?
Many thanks!