- Home /
Loading large scenes at runtime from proprietary file format using streaming
I am trying out Unity (Pro trial) to make a 3D model viewer app on iOS (and later Android). I want to show the user models in the app's Documents folder, and let him/her pick what to display. These models use a custom, proprietary format, the parsing of which is performed by a static library written in C++. The scenes are completely static.
I succeeded in calling back and forth between Unity's C# script and the native loader, and created GameObject instances dynamically, having MeshFilter and MeshRenderer components. I also loaded Texture2Ds and Materials from the file. It renders fine, but the framerate is choppy.
My goal is to have Unity stream in and out parts of the model dynamically, so that large (meshes above 100MB of triangles, not counting textures) scenes could be visualized on tablets.
Using the Resources folder is a no-go, as models cannot be prepackaged with the app (as I understand from the docs, the Resources folder is prepackaged in the app bundle at build time). AssetBundles are only a go, if it is possible to make a tool that converts these proprietary files to them (as I understand, it is not possible, as the Editor is required to do this).
What are my options?
You probably won't want to hear this, but I think you need to think of Unity as a display package. It'll display whatever you send to it. So, if you load a 100$$anonymous$$B data file, convert that into meshes etc, then Unity will display it for you. As I understand it, your problem is how to reduce the amount of data that you hand over to Unity. That to me means you need to be able to polygon-reduce the model as you load it, or load it in chunks. The Resources and AssetBundle concepts are intended to let an app load in carefully prepared assets that have been tweaked and adjusted during development to run on the device.
Thanks for the input Graham! This is exactly what I was fearing. So Unity's asset optimization features require the editor to process the assets at project build time, which is 99.99999% of all use cases. Alas, I fall into that tiny portion who want this on the fly.
Your answer

Follow this Question
Related Questions
About Unity Render Streaming Package 0 Answers
Create DLC mini games AssetBundles 0 Answers
Dynamic conversion of any uploaded mesh to assetbundle? 0 Answers
Export objects to a .3DS file at runtime 1 Answer
Stream music in Unity mobile 0 Answers