Loading external images without stutter

Hi,

For our project we need to load images from streaming assets or a webservice.
We can’t load them as ressources because images can change, and there is about 100.000 images.
We don’t need to load them all, but we need to load a bunch of images while an other previously loaded bunch of images are moving.

How can i do this without freezing the app? :
When i load images, the moving ones seems to stutter

I tried sevaral things, like coroutines or tasks, but unfortunnaly nothing works, always stuttering.
Does anybody knows how to accomplish that?
Is there a way to load external images on a different thread?

Thank you for your help,Hi,

For our project we need to load images from streamingassets or a webservice.
We can’t load them as ressources because images can change, and there is about 100.000 images.

We need to load images while other images are moving (others loaded previously).

How can i do this without freezing the app? :
When i load images, the moving ones seems to stutter

I try sevaral things, like coroutines or tasks, but unfortunnaly nothing works.
Does anybody knows how to accomplish that?
Is there a way to load external images on a different thread?

Thank you for your help

Hi,
Certainly @thomh_unity ! :
First, this is a try to see how Unity manage loading external file for my project.
I use UI raw images, to avoid use of sprite creation.
So, i use a scene with:

  • A red square with a looping animation going from left to right and back
  • 10 raw images.

Each raw image has a ImageTextureLoader.cs (joint file ImageTextureLoader.txt), loading behavior with coroutine using UnityWebRequestTexture.
In my main cs, i load each texture one after the other.
Pictures are jpg, from 4.8 Mo to 8.9 Mo

The stutter occurs on loading file, or while affecting texture to raw image, i don’t know precisely.
But i can see the stuttering on the animated red square.

Best regards
David
[138498-imagetextureloader.txt|138498]