The model asset pipeline loads a gltf scene and loads and loads the mesh and material data. The material data requests the textures it needs.
More...
#include <ModelAssetPipeline.h>
The model asset pipeline loads a gltf scene and loads and loads the mesh and material data. The material data requests the textures it needs.
Definition at line 41 of file ModelAssetPipeline.h.
◆ ModelAssetPipeline()
Create a model asset loading pipeline.
- Parameters
-
| meshAssetManager | Manager that owns mesh assets |
| materialAssetManager | Manager that owns material assets |
| modelAssetManager | Manager that owns model assets |
| skinAssetManager | Manager that owns skin assets |
| animationAssetManager | Manager that owns animation assets |
| textureAssetManager | Manager that owns texture assets referenced by models |
| assetLoaderPool | Thread pool used for model loading work |
| assetManager | Optional asset manager for texture handle registry access |
◆ ~ModelAssetPipeline()
| Engine::Ecs::ModelAssetPipeline::~ModelAssetPipeline |
( |
| ) |
|
Destroy the pipeline and its owned glTF loader resources.
◆ discardPendingWork()
| void Engine::Ecs::ModelAssetPipeline::discardPendingWork |
( |
| ) |
|
Clears all queued and in-flight model loading work.
◆ hasPendingWork()
| bool Engine::Ecs::ModelAssetPipeline::hasPendingWork |
( |
| ) |
const |
|
inlinenodiscard |
Check if the pipeline still has in-flight work (loading, meshlet generation, etc.) Used to defer buffer rebuilds until all meshes from a model have finished processing.
- Returns
- true if there are pending model loads, primitive data, or meshlet generations
Definition at line 110 of file ModelAssetPipeline.h.
References assetQueue_, materialResults_, meshletGenerationFutures_, modelLoadingFutures_, pendingKtx2Futures_, pendingMeshletCompletions_, and primitiveDataFutures_.
◆ processKtx2Textures()
| void Engine::Ecs::ModelAssetPipeline::processKtx2Textures |
( |
bool | async = true | ) |
|
|
private |
◆ processMaterial()
| void Engine::Ecs::ModelAssetPipeline::processMaterial |
( |
bool | async = true | ) |
|
|
private |
◆ processMeshData()
| void Engine::Ecs::ModelAssetPipeline::processMeshData |
( |
bool | async = true | ) |
|
|
private |
◆ processModel()
| void Engine::Ecs::ModelAssetPipeline::processModel |
( |
bool | async = true | ) |
|
|
private |
◆ processSkinData()
| void Engine::Ecs::ModelAssetPipeline::processSkinData |
( |
bool | async = true | ) |
|
|
private |
◆ processTextures()
| void Engine::Ecs::ModelAssetPipeline::processTextures |
( |
Assets::Model * | modelAsset, |
|
|
const std::shared_ptr< tinygltf::Model > & | gltfModel, |
|
|
const std::filesystem::path & | modelPath ) |
|
private |
Extracts and registers texture assets from loaded glTF models.
Called during processModel() to extract images from model.images[] and create GltfTextureAsset entries in the TextureAssetManager.
- Parameters
-
| modelAsset | The model asset containing the loaded tinygltf::Model |
| gltfModel | Model to extract the textures from |
| modelPath | Path to the glTF file for resolving texture paths |
◆ setAssetImportPipeline()
◆ setRenderingDataManager()
| void Engine::Ecs::ModelAssetPipeline::setRenderingDataManager |
( |
Core::RenderingDataManager * | renderingDataManager | ) |
|
|
inline |
Sets the RenderingDataManager to notify when meshes/materials are loaded.
- Parameters
-
| renderingDataManager | Pointer to the RenderingDataManager |
Definition at line 89 of file ModelAssetPipeline.h.
References renderingDataManager_.
◆ submitAsset()
| void Engine::Ecs::ModelAssetPipeline::submitAsset |
( |
const std::filesystem::path & | asset | ) |
|
Requests the load of a gltf file.
- Parameters
-
| asset | path to the asset to load. Only use relative paths! |
◆ submitLoadModel()
| void Engine::Ecs::ModelAssetPipeline::submitLoadModel |
( |
bool | async = true | ) |
|
|
private |
◆ takePendingMeshletCompletions()
Get and clear pending meshlet completions. Call this at a safe point to retrieve completed meshlet generations that need to be written to the registry.
- Returns
- Vector of completed meshlet generation results
◆ tick()
| void Engine::Ecs::ModelAssetPipeline::tick |
( |
bool | async = true | ) |
|
Advances all stages of the model loading pipeline.
- Parameters
-
| async | Whether to poll asynchronous work without blocking |
◆ animationAssetManager_
◆ assetImportPipeline_
◆ assetLoaderPool_
| NamedThreadPool* Engine::Ecs::ModelAssetPipeline::assetLoaderPool_ = nullptr |
|
private |
◆ assetManager_
◆ assetQueue_
| std::vector<std::filesystem::path> Engine::Ecs::ModelAssetPipeline::assetQueue_ |
|
private |
◆ loader_
◆ materialAssetManager_
◆ materialResults_
◆ meshAssetManager_
◆ meshletGenerationFutures_
◆ modelAssetManager_
| Assets::ModelAssetManager* Engine::Ecs::ModelAssetPipeline::modelAssetManager_ = nullptr |
|
private |
◆ modelLoadingFutures_
| std::vector<GltfModelFuture> Engine::Ecs::ModelAssetPipeline::modelLoadingFutures_ |
|
private |
◆ pendingKtx2Futures_
| std::vector<Ktx2LoadFuture> Engine::Ecs::ModelAssetPipeline::pendingKtx2Futures_ |
|
private |
◆ pendingMeshletCompletions_
◆ primitiveDataFutures_
| std::vector<std::future<PrimitiveDataLoading> > Engine::Ecs::ModelAssetPipeline::primitiveDataFutures_ |
|
private |
◆ renderingDataManager_
| Core::RenderingDataManager* Engine::Ecs::ModelAssetPipeline::renderingDataManager_ = nullptr |
|
private |
◆ skinAssetManager_
◆ textureAssetManager_
◆ threadPool_
| NamedThreadPool* Engine::Ecs::ModelAssetPipeline::threadPool_ = nullptr |
|
private |
The documentation for this class was generated from the following file: