Exploring the optimal method for loading a 3D model in a three.js JavaScript application, specifically when the model is created in Blender, poses an intriguing challenge.
The current workflow entails:
- Designing the model in Blender.
- Exporting using the three.js exporter.
- Loading from javascript utilizing
THREE.JSONLoader
While this process works effectively, the resulting JSON file can reach sizes of approximately 4MB. Hence, it becomes imperative to seek methods to minimize this size without compromising performance. Potential solutions include: -
- Minimization of the JSON file (albeit challenging due to limited js minifiers functionality), or
- Utilizing gzip compression (though requiring specific configurations), or
- Adopting a binary format (after converting back to JSON) or
- Implementing OpenCTM format (hampered by compatibility issues with Blender 2.70).
Research conducted includes detailed studies such as here, here, here and here. The overarching consensus revolves around the approaches outlined above, each presenting its unique challenges.
Therefore, the query lingers - what constitutes the most favorable approach in terms of optimizing performance during the model loading phase?
Update
Considering the time elapsed since posing this question, I felt compelled to share the strategy I ultimately pursued. I opted to optimize the models, reducing vertex count while maintaining visual quality at the desired scale. Additionally, I implemented client-side caching within indexeddb as a blob.