Hello,
TArray<uint8> rawData;
uint32 texSizeX = landscapeTextures[l]->Source.GetSizeX()/ (Mip + 1);
uint32 texSizeY = landscapeTextures[l]->Source.GetSizeY()/ (Mip + 1);
uint32 arraysize = landscapeTextures[l]->Source.GetBytesPerPixel() * (texSizeX*texSizeY);
rawData.AddZeroed(arraysize);
landscapeTextures[l]->Source.GetMipData(rawData, Mip);
for (int c = 0; c < rawData.Num(); c+=4)
{
//rawdata is BGRA
FColor color = FColor(rawData[c + 2], rawData[c + 1], rawData[c], rawData[c + 3]);
texColors[l].Add(color);
}
This code will return proper colors when the Mip variable is 0. Any other value for the Mip level will return 0 for all bytes in the rawData array.
I know I initialize it with AddZeroed, but the array still isn’t getting filled with any byte values from the GetMipData function when Mip>0.
I even commented out that Mip bias snippet from the texSizeX and Y lines. Still nothing. Bug?