I'm working on a Hololens app that displays a PNG image with info for the user. The images are loaded from a StreamingAssets folder in a coroutine. The issue lies in the speed at which these assets are loaded. If the user cycles to another page, the app momentarily drops to about 1-3 FPS on a PC.
What I hope some of you can help me with is think of ways to optimize the storage and streaming of these images. Is there a way to for example, load the image in a lower resolution to save on time and memory (with the hardware's very limited memory) and load in the additional detail when it actually needs to be displayed? Would multi-threading make the framerate better while loading the image?
So Programmer's suggestion in the comments helped eliminate the performance issues completely. The code down below is the coroutine that is used to stream in the required image(s) upon startup.
The issue on the Hololens lies in the
www.LoadImageIntoTexture(tex);
line. This code is required when displaying multiple images on the PC side of things, however on the Hololens, where only one image is displayed at a time it can be left out.