I’m trying to figure how can I load models and textures in the most efficient way with Unity3D at run-time (For example, apps like IKEA with AR - they have many models in the app, I want to be able to instantiate them really fast, without having them locally on my app) , so far I’ve read about glTF formats, Draco API, and currently I’ve implemented a simple procedure which works really slow. I’m using BestHTTP and for textures I’m doing this:
var texFoundPath = Directory.GetFiles(outFolder, texFileName, SearchOption.AllDirectories).Single();
Debug.Log("Loading texture from " + texFoundPath);
var texBytes = File.ReadAllBytes(texFoundPath);
Texture2D tex = new Texture2D(2,2);
tex.LoadImage(texBytes);
And using ObjImporter for importing objects.
var gameObject = ObjImporter.Import(objStr, mtlStr, textureHashtable);
So at run-time, models that are 3-5mb takes up to 3-5 seconds to load. Which is very slow and not suitable for anything. Doing this locally will result in a 200-300mb apk if I have around 100 models.
So currently I’m looking for a way to do this efficiently, and would love your help. I think it’ll be the best to load the models with Draco API. but my I’m not sure how to create the plugin that will communicate with that API.