The question is answered, right answer was accepted
What is the best solution to load models at runtime?
I am building a VR software which needs to have a folder filled with model files, and based on XML files I want to build compositions of them. The list of models needs to be updatable by time, so new models will come and go.
A
| This is a must. I cannot change anything.
What I tried so far:
Because of future updates assets and prefabs are not a solution since they cannot be created at runtime, and needs to be built in the project.
I tried to load them manually from an .OBJ file with .PNG texture files as materials, the model is imported successfully, however it made the framerate drop to 10 even in a coroutine, where I load every single model in different frames. In the end it takes 4-5 seconds to load about 300k verts. Since its a VR software fps should always be over 30-60 to avoid motion sickness and dizziness.
I already spent a week looking for the best answer, but people who need this kind of jobs done either smarter than me therefore don't need help, or don't need this kind of solution at all.
Have you profiled the game when / after the object is loaded?
I don't believe changing the loading method will do anything on the framerate after the object is loaded. If your object is too complex with too many (complex) shaders, and a computer not performant enough, then, I don't believe you will find a magic solution to your problem.
Answer by pcdrive · May 30, 2021 at 06:41 PM
Best solution seems to be to create AssetBundles. Their load time are far better than reading models directly, and the best thing about them is that they keep ALL their settings, scripts, and every data on themselves.
For those who want to know more: I found a video of a guy, who shows literally everything in 10 minutes, without going in to the details too much.
Link for the vied I've talked about.
Follow this Question
Related Questions
Best way to let player manage assets in runtime ? 1 Answer
Dynamically Loading Unity Content Without Publishing App Store Update 1 Answer
Using singleton pattern - cannot access private/protected method which is public 2 Answers
How to store LOTS of game assets to QUICKLY find and load in runtime 1 Answer
Unity Android APP only in background 0 Answers