I am using Unity to create a news-browsing app for the HTC Vive. My app uses WWW.LoadImageIntoTexture to dynamically create textures from internet images. The problem is that WWW.LoadImageIntoTexture is synchronous and sometimes even one call per-frame is enough to trash the framerate. Is there any way to load images asynchronously? Here are some things I tried:
- Loading only one image per frame
- Reducing image size by passing all images through an http service that shrinks the image size
Both solutions helped but neither one solved the problem sufficiently. So I have two questions:
-
Is there an asynchronous alternative to WWW.LoadImageIntoTexture?
-
Is it possible to preprocess images outside of unity so that unity can load them faster? e.g. is Texture.SetPixels faster than WWW.LoadImageIntoTexture? What is the fastest Unity API for taking a preprocessed image and converting it into a texture? What would be a good way to preprocess the image outside of unity with reasonably low latency?