i do know read/write and texture size will affect runtime memory usage
our project loads texture images on our own dedicated server and transform them into texture at runtime by code, we also have some sussy code that will manipulate pixel one by one to blur some of them
the workflow : download image from server -> save them in local files (like %appdata% on windows) -> reload them from the local files
->save
if (savePath.Contains("blur"))
{
#if UNITY_ANDROID || UNITY_IOS
Texture2D convertedResource = new Texture2D(4, 4, TextureFormat.ETC2_RGBA8Crunched, false);
#else
Texture2D convertedResource = new Texture2D(1, 1, TextureFormat.RGB24,false);
#endif
convertedResource.LoadImage(webRequest.downloadHandler.data);
convertedResource = BlurTexture(convertedResource); //warning: pixel data manipulation will cause heavy RAM usage
File.WriteAllBytes(savePath, convertedResource.EncodeToPNG());
}
else
{
File.WriteAllBytes(savePath, webRequest.downloadHandler.data);
}```
->load
```cs
public Texture2D LoadTextureFromLocal(string fileName, bool isMipMap = false)
{
string filePath = $"{Application.persistentDataPath}{agent_image_default_path}{fileName}.png";
if (!File.Exists(filePath)) { return null; }
#if UNITY_ANDROID || UNITY_IOS
Texture2D texture = new Texture2D(4, 4, TextureFormat.ETC2_RGBA8Crunched, isMipMap);
#else
Texture2D texture = new Texture2D(1, 1, TextureFormat.RGB24, isMipMap);
#endif
texture.LoadImage(File.ReadAllBytes(filePath), true);
texture.name = fileName;
return texture;
}```
however, any texture that is generated from this cannot be viewed, inspected during runtime on editor, and from the memory profiler i can see they are wasting tons of resources, like 14mb per texture, no way