天又晴 发表于 2023-10-1 19:15:31

UE4纹理共享插件的使用

本帖最后由 天又晴 于 2021-4-21 09:39 编辑

跨虚幻实例、nDisplay设备和其他图形应用程序共享GPU数据并绕过CPU。


纹理共享 将数据保存在GPU内存中,绕过CPU及其高昂的内存复制操作开销,从而高效地在进程之间发送和接收GPU数据。

1.UE4开启TextureShare插件

2.将插件内容中蓝图 BP_TextureShare_Postprocess 对象添加到你的场景

3.打开蓝图将IsServer设置为True,创建另一个虚幻项目重复上述步骤并将IsServer设置为False

4.在发送和接收设置相同的名字,服务器和客户端都可以互相发送接收




插件中BP_TextureShare_Scene蓝图可以直接共享发送UE4画面 接收端可以指定下列 TEXT()中的Name进行接收
namespace TextureShareStrings
{
      namespace texture_name
      {
                static constexpr auto SceneColor = TEXT("SceneColor");

                static constexpr auto SceneDepth = TEXT("SceneDepth");
                static constexpr auto SmallDepthZ = TEXT("SmallDepthZ");

                static constexpr auto GBufferA = TEXT("GBufferA");
                static constexpr auto GBufferB = TEXT("GBufferB");
                static constexpr auto GBufferC = TEXT("GBufferC");
                static constexpr auto GBufferD = TEXT("GBufferD");
                static constexpr auto GBufferE = TEXT("GBufferE");
                static constexpr auto GBufferF = TEXT("GBufferF");

                static constexpr auto LightAttenuation = TEXT("LightAttenuation");
                static constexpr auto LightAccumulation = TEXT("LightAccumulation");
                static constexpr auto LightingChannels = TEXT("LightingChannels");

                static constexpr auto GBufferVelocity = TEXT("GBufferVelocity");
                static constexpr auto Foveation = TEXT("Foveation");

                static constexpr auto DirectionalOcclusion = TEXT("DirectionalOcclusion");

                static constexpr auto BackBuffer = TEXT("BackBuffer");
      }
};

已知限制:
纹理共享项名称的最大长度为128个字符。

每个进程的纹理共享项最大数量为100。

每个纹理共享项的最大纹理数为10

zhouyan 发表于 2022-11-29 18:57:03

本帖最后由 zhouyan 于 2022-11-29 19:01 编辑

大佬你好,按照你教程为什么设置后,发送端可以,但是接收端运行就直接卡死(期望实现是一个UE发送共享纹理,另外一个接收然后通过材质球渲染到界面上),请问哪里出了问题呢,多谢大佬。

liubing129 发表于 2023-2-13 11:33:32

{:1_228:}
页: [1]
查看完整版本: UE4纹理共享插件的使用