Hi everyone, I’m currently getting the last rendered frame and passing it to a UTexture, this currently works fine on a build for PC and in-editor, but in xbox it breaks, it kind of “tiles” the image on the x axis, it’s not really a tile bc each part is different. Here’s the code I’m currently using:
void UScreenshotToTexture::CallbackScreenShot(int32 InWidth, int32 InHeight, const TArray<FColor>& InColors) { if(!MainTexture || InWidth != MainTexture->GetSizeX() || InHeight != MainTexture->GetSizeY()) MainTexture = UTexture2D::CreateTransient(InWidth, InHeight); #if WITH_EDITORONLY_DATA MainTexture->MipGenSettings = TMGS_NoMipmaps; #endif if(MainTexture) { MainTexture->CompressionSettings = TextureCompressionSettings::TC_Default; MainTexture->SRGB = 1; FTexture2DMipMap& Mip = MainTexture->GetPlatformData()->Mips[0]; void* Data = Mip.BulkData.Lock(LOCK_READ_WRITE); constexpr int32 stride = static_cast<int32>(sizeof(uint8) * 4); FMemory::Memcpy(Data, InColors.GetData(), MainTexture->GetPlatformData()->SizeX * MainTexture->GetPlatformData()->SizeY * stride); Mip.BulkData.Unlock(); MainTexture->UpdateResource(); } SetTexture(); }