可视化

在UE5中实现可编程的动态纹理

前言

实现

内存纹理创建。完整的源文件见下:

#include "CreateDynamicTexture.h"

UTexture2D * UCreateDynamicTexture::CreateDynamicTexture(int Width, int Height)
{
    int32 TextureWidth = Width;
    int32 TextureHeight = Height;
    UTexture2D *NewTexture = UTexture2D::CreateTransient(TextureWidth, TextureHeight, PF_B8G8R8A8, FName("MyColorMap"));

    return NewTexture;
}

效果

总结