- Home /
Send a mesh filter data(640kb) via PUN/UNET/Any network continously
I'm trying to send a mesh data(Mesh filter component) via Photon Unity Networking continuously. Also, it needs to be in sync like transform component. I tried using UNET, but I was not able to send the data(vertices,uvs,triangles approx 640kb) even after splitting the data in small chunks(because of channel buffer limit).
When I try sending the data using PUN, Unity Editor crashes.
In short, I need to send a 640kb data continuously via network in realtime. Is there any way I can solve this problem? It will be really helpful. Thank you in advance.
Note: Mesh data is from kinect sensor
When you say "continuously", do you mean you want to send 640kB across a network every frame? That's not going to happen....
Thank you Tanoshimi for your comment. Yes i want to transfer approx 640kb mesh filter data(vertices-vector3 array,uvs-vector2 array,triangles-int array) continuously. I want to sync my player's mesh filter data with others via network just like syncing a player's transform,rotation via network. In my case, mesh data will change every frame. But for my prototype, I'm ready to send my mesh data at some very high frequency(not every frame).
So, just to be clear, sending 640$$anonymous$$b every frame would require your players to have an internet connection that supported a transfer rate of about 35$$anonymous$$b/sec. I don't know anyone that has that. I'm not sure what you're trying to do, but if it's a skinned mesh, you need only transfer the bone positions - not the entire mesh.
What you're trying to do here is impractical, as others have already said. Could you share more information about what you're trying to accomplish here? $$anonymous$$aybe we can help you think of a better way to accomplish this.
Thank you for the comment jdean300. I'm trying to send mesh data from kinect sensor connected to one client via network, so that all clients can view the same without connecting to that kinect sensor. I'm calculating vertices,uvs,triangles from kinect sensor data and then transferring the same.
Answer by Pangamini · Jun 28, 2016 at 09:31 AM
You'd better think about some smart way how to sync what you are doing on the server and do some kind of prediction on clients. If you really need to update the whole mesh (I doubt it, there is always another way), perhaps you can try using some data compression, both lossless (LZMA or something) and lossy (do you really need floating point precision everywhere?). You may use some concept of dirtiness of certain areas of your mesh, so you only update what's been changed. Perhaps you can update just every 10th vertex every frame.
If you describe what's the exact purpose of transferring the mesh, people will be able to help you with a better solution.
Thank you for the suggestion Panga$$anonymous$$i.
I think data compression will suit my need. I'm trying to send mesh data from kinect sensor connected to one client via network, so that all clients can view the same without connecting to that kinect sensor.
Do the clients really need to see the entire raw data from kinect? I have worked with kinect a long time ago and there was only a skeleton available... I guess it can now scan some more detailed mesh. In any case, you may be able to reduce data types (floats to bytes, etc), remove data you don't need (Does kinect really output UVs? Aren't triangles always the same?) Think about custom ways how to interpret your data, even in a lossy way. Let's say the kinect's output mesh is just sort of a depth map (like a terrain) because there's a laser measuring distances from a single point.. you may be able to convert this data into a texture/bitmap and use very powerful jpeg compression to turn this data into a FFT. It's hard for me to imagine how does this mesh look like. But yo can certainly describe some its properties and (ab)use it to reduce the amount of data, you don't need to transfer every kind of mesh.
I am trying to send only the data that I really need to reconstruct the mesh on the client side. Also, I'm dividing the data into chunks, and optionally compressing it beforehand.
Note:Vertices,UVS,triangles are calculated from $$anonymous$$inect data.