This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2021 Impossibility Labs Inc. https://github.com/ArtheonVR. | |
// Based on: https://answers.unrealengine.com/questions/607129/how-do-you-generate-mips-at-runtime.html | |
void FAsyncTaskDownloadTexture::GenerateMipmaps() const { | |
const int32 Width = Texture->GetSizeX(); | |
const int32 Height = Texture->GetSizeY(); | |
// Texture bytes. | |
TArray<uint8> TextureByteArray; | |
TextureByteArray.AddUninitialized(Texture->PlatformData->Mips[0].BulkData.GetElementCount()); |