but I need to read it from SOMEWHERE
Currently I’v done this:
UGameViewportClient* ViewportClient = World->GetGameViewport()
GetViewportScreenShot(ViewportClient->Viewport, …)
but ViewportClient->Viewport->GetRenderTargetTexture() is EMPTY in Package (in editor it have proper value)
My other idea (with I do not like much) is to have USceneCaptureComponent2D component around somewhere and divide SaveGame into two ticks, in first tick save all data I need into the archive and place USceneCaptureComponent2D where my main camera is, and call UpdateContent() on it, on the next tick just grab contnent of USceneCaptureComponent2D bound TextureTarget and read pixels from there, and finish making save (save thumbnail & archive) … while this method works, it seems ‘little’ overcomplicated and have issues (the thumbnail sshot is not identical to the game screenshot (some postprocessing effects does not appear in capture and there is visible shutter (normally frame takes 16ms, while the frame when the capture is rendered takes about 60ms :/)
(writing my stuff to archive takes about 3 - 4 ms, so it’s not that).