在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;
}

效果

总结


文章作者: 陈肖笑
版权声明: 本博客所有文章除特別声明外,均采用 CC BY-NC 4.0 许可协议。转载请注明来源 陈肖笑 !
  目录