The problem lies probably in your UV’s (it was my case), but if not, you could use this to parse the Texture and write it the way you want: How can I use ConstructTexture2D in Console Builds?
For example, if you want to flip it Horizontally:
// Lock and copies the data between the textures
TArray SurfData;
FRenderTarget* RenderTarget = TextureRenderTarget->GameThread_GetRenderTargetResource();
RenderTarget->ReadPixels(SurfData);
// Lock the texture so it can be modified
uint8* MipData = static_cast<uint8*>(Texture->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE));
// Create base mip.
int32 Height = FMath::FloorToInt(DrawSize.Y);
int32 Width = FMath::FloorToInt(DrawSize.X);
uint8* DestPtr = NULL;
const FColor* SrcPtr = NULL;
for (int32 y = 0; y < Height; y++)
{
DestPtr = &MipData[(Height - 1 - y) * Width * sizeof(FColor)];
SrcPtr = const_cast<FColor*>(&SurfData[((Height - y) * Width)-1]);
for (int32 x = 0; x < Width; x++)
{
*DestPtr++ = SrcPtr->B;
*DestPtr++ = SrcPtr->G;
*DestPtr++ = SrcPtr->R;
*DestPtr++ = SrcPtr->A;
SrcPtr--;
}
}
// Unlock the texture
Texture->PlatformData->Mips[0].BulkData.Unlock();
Texture->UpdateResource();
If you want to flip it Vertically, it should be something like this: (I didn’t tried)
for (int32 y = 0; y < Height; y++)
{
DestPtr = &MipData[(Height - 1 - y) * Width * sizeof(FColor)];
int32 Line = FlipVertically ? y : (Height - 1 - y);
int32 LastColumnStart = FlipHorizontally ? Width - 1 : 0;
int32 Index = Line * Width + LastColumnStart;
SrcPtr = const_cast<FColor*>(&SurfData[Index]);
for (int32 x = 0; x < Width; x++)
{
*DestPtr++ = SrcPtr->B;
*DestPtr++ = SrcPtr->G;
*DestPtr++ = SrcPtr->R;
*DestPtr++ = SrcPtr->A;
FlipHorizontally ? SrcPtr-- : SrcPtr++;
}
}