How to best synchronize a byte array?

I have a texture2D and I want to be in sync with everyone in the room so I converted the data into a byte array and sent it. This method makes the data sent quite large so synchronization is slow. Is there another way? What about RealtimeArray?
5 Replies
kapa.ai
kapa.ai6mo ago
Hi @Trần Tiến Đạt. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain specific information on synchronizing a byte array or using a RealtimeArray in NormalVR. However, they do mention that Normcore uses RealtimeComponents to synchronize data in your application, and that these components synchronize state between the Unity scene and a model in the Normcore datastore. For complex objects such as a Texture2D, the sources suggest picking out the pieces of data you would like to synchronize and using a RealtimeModel to synchronize them, as it's not possible to store a complex object in a model. You might want to check out the guide on Synchronizing custom data (https://normcore.io/documentation/realtime/synchronizing-custom-data) for more information on how to use a RealtimeModel in practice. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@1152048129353461810> kapa.ai is still learning and improving, please let us know how it did by reacting below
Trần Tiến Đạt
But when I convert texture2D into a byte array, then send it, can it still be synchronized?
Mechabit
Mechabit6mo ago
normcore isn't well suited to sending large files, better to upload it to amazon cloud and sync the url
liamc
liamc6mo ago
We send ultra-low-res, ultra-low-frame rate video via byte arrays. Its definitely possible, but once the res increases it fails to send so much data The texture is downscaled to 32x32 and serialized into a byte array using 3 bytes for each RGB pixel, and then loaded back into a texture using Texture.LoadRawTextureData(byteArray)