I am trying to load very high quality images from the server. (4K image 8192 * 8192 ↑)
The problem is that this image is just one of many content.
I do not want the FPS to be lowered while loading this image. So, I wonder how you can increase the load speed while maintaining high quality.
Of course, I know that lowering the resolution or lowering the quality of the image will improve the loading speed accordingly.
But I would like to maintain very high quality.
If have a good idea or someone who has solved this, please help me.
Unity version - 5.6.0p3, 2017.1.0p1
Target platform - PC, Mac & Linux Standalone
PC - High specification
If at all possible, I think English is needed on the forums.
Translation: (Google Translate)
“This may be helpful for me. I need to look at the code.
thank you for helping me”
Thank you for letting me know about a nice feature called the stopwatch.
But what I want is the ability to load faster than the API provided by Unity…T-T
I personally would recommend (HIGHLY RECOMMEND), using the native image compression format per platform (e.g.: DDS, PVR )… strip their headers, and load directly to GPU via Texture2D.LoadRawTextureData
the reason why it takes so long to load if you are using JPEG or PNG is because of the decoder it has to run through to “get” to the native format to load to the GPU… there is no getting around it at all and can add 300ms per decode or more… been there, done that.
go with native images and be happy.
[edit]
to add… this should all be done outside of your download routine… just download your pre-processed images (DDS, or PVR… whatever platform specific image format, without their headers!)… and read in their byte array… load with the loadrawtexturedata method, check out the link above for the other steps, but I have solve this very problem. I guarantee it makes a huge difference. promise.
Based on what you’ve stated, you are downloading these from a server right?
Well… you are going to have to do some work on the JPEG on the server side to convert it to the native image file format (DDS or PVR).
Before loading it with Texture2D.LoadRawTextureData you must remove the header of the image from the byte[ ]. This can be done on either the server before sending, or on the device. You will want to do it on the server so that the client only needs to read the byte[ ] and load.