Best practice sending over image files from backend server to HoloLens?
I'm currently using a JSON txt file as a configuration file to get several lightweight stuff like strings and numbers. But for my current project I want to get some images from my own webserver and show it into the HoloLens app.
The thing is: I want it to be configurable, and for that purpose I'm currently using a Base64 byte array in a JSON file to get the image. Problem is, when I read and process this array the HoloLens app freezes for a couple of seconds when the app gets started and I initialize the JSON.
I presume there is a better way to load images dynamically, but what is the better way?
How are you loading the JSON file and the images? From inside a Coroutine?
You can try to do all of the work on other thread and then use InvokeOnAppThread() to to constructed the texture2D object that unity uses. But this also can cause lag since most of the function unity uses to load images are synchronous, so you can use a coroutine inside the function written inside InvokeOnAppThread to set the texture pixel by pixel and yield the coroutine once it exceeds a certain time threshold. The last approach increase the loading time (not by much if you are loading images sparsely) but it ensures a smooth experience
@gkh38 : Any news? Could you improve the dynamic loading of images?
Hmmm, never really had any problem loading images dynamically. Just dump your image data into the texture and you should be good to go. What methods are you using to load your image? And what seems to be the bottleneck(parsing your json or loading the texture)? Can either @gkh38 or @HoloFan elaborate on what the performance problem is?
Going to close this. It's probably been archived by google by now.