Description:
Currently, FunGT loads models sequentially via Model::load(). Loading multiple large models (like Pixar assets) can block the main thread and result in noticeable delays. To improve performance and scalability, we should implement a hybrid parallel model loader similar to Blender and modern game engines.
Proposed Solution:
-
Internal parallelism inside Model::load()
- Use Intel TBB (
tbb::parallel_for) to process meshes, materials, and textures within a single model.
- This speeds up loading large individual models.
-
External model loading manager
- Create a
ModelLoader class or task queue to handle multiple models concurrently.
- Allows users to enqueue multiple models without manually spawning threads.
- Provides methods like
waitForAll() or progress tracking.
-
GPU synchronization
- Keep GPU buffer creation on the main thread to ensure thread safety with OpenGL.
- CPU parsing and data preparation remain parallel.
Benefits:
- Fast loading of large individual models.
- Allows multiple models to load concurrently without user pain.
- Mirrors Blender and game engine best practices.
Optional Enhancements:
- Lazy loading / streaming for very large assets.
- Limit concurrency via TBB task arena to prevent oversubscription.
References / Inspiration:
- Blender: Uses TBB for dependency graph, physics, modifiers, and asset import.
- Game engines (Unreal, Unity, Godot): Separate CPU parse and GPU upload; job/task systems for async model loading.
Suggested Labels:
enhancement
performance
tbb
model-loading
Suggested Milestone:
v1.2 (or next performance-focused release)
Description:
Currently, FunGT loads models sequentially via
Model::load(). Loading multiple large models (like Pixar assets) can block the main thread and result in noticeable delays. To improve performance and scalability, we should implement a hybrid parallel model loader similar to Blender and modern game engines.Proposed Solution:
Internal parallelism inside
Model::load()tbb::parallel_for) to process meshes, materials, and textures within a single model.External model loading manager
ModelLoaderclass or task queue to handle multiple models concurrently.waitForAll()or progress tracking.GPU synchronization
Benefits:
Optional Enhancements:
References / Inspiration:
Suggested Labels:
enhancementperformancetbbmodel-loadingSuggested Milestone:
v1.2(or next performance-focused release)