Share Texture over Boygroup - Unity DX11 to vvvv

Hi everyone,

I got a question:
How could it be possible to share a directx 11 texture, coming from unity, via a boygroup with 8 client pcs?

My Setup:
I got one master pc and 8 client/slaves pcs. Boygroups work fine. vvvv program files, packs, addons, plugins, modules and project files are “synchronized” (they exist on every of the pcs in the same directory). All PCs are connected via Gigabit Ethernet.
I’m able to get the render output of Unity into an DX11 renderer on my master. I just downloaded the Unity example project from here https://github.com/benkuper/Unity-Plugins/tree/master/SpoutPlugin/UnitySpoutDemo. I runned the “MultiSender” scene and a command prompt window came up (make sure the Debug Console bool in the Spout2Sender script component is true).The command line window popping up gave me the index/SendSharingHandle of Unity’s render output. I get the index e.g. “-2147477128” and use it with FromSharedTexture (DX11.Texture2d) by @vux. No big deal. Everything is working fine. I can see the Unity render output in vvvv, mirrored but anyways it works.

Now I’d like to share the texture with my clients/slaves in the boygroup.

I wonder how this could be possible.

I thought of converting the textures into Strings or RAW… but I didn’t found a solution to convert them from Strings or RAW to textures.

Could some work with me for a solution?

Best,

huppys

there is an example for DX9
“girlpower\Graphics\DX9\Texture\Network_Streaming.v4p”
and then you can use the DX9ToDX11 module…

Thank you, joreg! Looks fine at a first look. I have to adapt it tomorrow, unfortunately. I’ll keep you up-to-date.

Those examples are very well hidden. Why?

I got a look into this patch and modified it. Sending the RAW information via UDP looks better, it seems to be more constant and reliable.

But: Not all frames are being transferred. I can see a lot of flickering in the client render outputs as there are black frames in between the rest of the frames coming from the server.

EDIT: The flickering was caused by the format the DynamicTexture (EX9.Texture Raw) was using. I set it to “DXT5” and everything works fine now. So I can see my Unity rendering output on all of the slaves, transferred via UDP.

Another thing is: On the receiver side, the raw information go into the DynamicTexture (EX9.Texture Raw) node. I’d like to change this to a DX11 “Raw to texture” node. But it seems there is no node for this purpose. Or am I missing something?

What do you think about this?

Best,

huppys

Shared DX11 Texture from Unity via UDP/TCP (15.6 kB)

true the equivalent for dx11 does not (yet) exist. if you’re a bit into coding it shouldn’d be too hard to implement.

meanwhile try DX9ToDX11 (DX11.Texture 2d).

re flickering:
should be caused by frames that are bigger than max transmition size. with dxt5 you get fixed size (as opposed to eg. jpg). still going bigger with the texture should cause troubles on udp but not on tcp.