|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
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 <FrameProcessing.h>
Public Member Functions | |
| ModelAssetPipeline (EngineCore::MeshAssetManager *meshAssetManager, EngineCore::MaterialAssetManager *materialAssetManager, EngineCore::ModelAssetManager *modelAssetManager, EngineCore::TextureAssetManager *textureAssetManager, NamedThreadPool *assetLoaderPool, EngineCore::AssetManager *assetManager=nullptr) | |
| void | submitAsset (const std::filesystem::path &asset) |
| Requests the load of a gltf file. | |
| void | tick (bool async=true) |
| void | setRenderingDataManager (EngineCore::RenderingDataManager *rdm) |
| Sets the RenderingDataManager to notify when meshes/materials are loaded. | |
| std::vector< Ecs::CompletedMeshletGeneration > | 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. | |
Private Member Functions | |
| void | submitLoadModel (bool async=true) |
| void | processModel (bool async=true) |
| void | processMaterial (bool async=true) |
| void | processMeshData (bool async=true) |
| void | processTextures (EngineCore::ModelAsset *modelAsset, const std::filesystem::path &modelPath) |
| Extracts and registers texture assets from loaded glTF models. | |
Private Attributes | |
| EngineCore::MeshAssetManager * | meshAssetManager |
| EngineCore::MaterialAssetManager * | materialAssetManager |
| EngineCore::ModelAssetManager * | modelAssetManager |
| EngineCore::TextureAssetManager * | textureAssetManager |
| EngineCore::RenderingDataManager * | renderingDataManager = nullptr |
| EngineCore::AssetManager * | assetManager_ = nullptr |
| For TextureHandleRegistry access. | |
| NamedThreadPool * | threadPool = new NamedThreadPool( 4, "Gltf loader" ) |
| EngineCore::GltfLoader * | loader = new EngineCore::GltfLoader(threadPool) |
| std::vector< std::filesystem::path > | assetQueue |
| std::vector< Ecs::GltfModelFuture > | modelLoadingFutures |
| std::vector< std::future< Ecs::MaterialLoadingData > > | materialFutures |
| std::vector< std::future< Ecs::PrimitiveDataLoading > > | primitiveDataFutures |
| std::vector< std::future< Ecs::CompletedMeshletGeneration > > | meshletGenerationFutures |
| std::vector< Ecs::CompletedMeshletGeneration > | pendingMeshletCompletions_ |
| NamedThreadPool * | assetLoaderPool = nullptr |
Friends | |
| class | EngineCore::AssetManager |
| class | EngineCore::Engine |
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 90 of file FrameProcessing.h.
|
explicit |
Definition at line 158 of file FrameProcessing.cpp.
References assetLoaderPool, assetManager_, materialAssetManager, meshAssetManager, modelAssetManager, and textureAssetManager.
|
private |
Definition at line 658 of file FrameProcessing.cpp.
References Asset::AssetBase::data, Ecs::MaterialLoadingData::data, EngineCore::DIFFUSE_FLAT_COLOR, EngineCore::DIFFUSE_SHADER, EngineCore::DYNAMIC_TEXTURES, Ecs::RegistryManager::get(), Asset::Path::getAssetHandle(), EngineCore::L0_SHADER, EngineCore::L1_SHADER, EngineCore::L2_SHADER, materialAssetManager, materialFutures, EngineCore::MOVABLE_DIFFUSE_SHADER, EngineCore::NORMALS_SHADER, Ecs::MaterialLoadingData::path, processMaterial(), renderingDataManager, EngineCore::STATIC_LIGHTMAP, Ecs::MaterialLoadingData::type, EngineCore::MaterialAsset::type, and EngineCore::UnpackOptional().
Referenced by processMaterial(), and tick().
|
private |
Definition at line 757 of file FrameProcessing.cpp.
References Asset::AssetBase::data, Ecs::PrimitiveDataLoading::data, Ecs::RegistryManager::get(), Asset::Path::getAssetHandle(), Asset::AssetBase::getEntity(), Ecs::PrimitiveDataLoading::materialPaths, meshAssetManager, meshletGenerationFutures, Ecs::PrimitiveDataLoading::path, pendingMeshletCompletions_, primitiveDataFutures, Ecs::MeshPrimitiveData::primitives, processMeshData(), threadPool, TRACY_ZONE_SCOPED_NAMED, TRACY_ZONE_SCOPED_NAMED_ASSET, and EngineCore::UnpackOptional().
Referenced by processMeshData(), and tick().
|
private |
Definition at line 223 of file FrameProcessing.cpp.
References assetLoaderPool, assetManager_, EngineCore::BaseColor, EngineCore::Emissive, EngineCore::TextureHandleRegistry::getOrCreateHandle(), EngineCore::Lightmap, loader, materialAssetManager, materialFutures, meshAssetManager, EngineCore::MetallicRoughness, EngineCore::ModelAsset::model, modelAssetManager, modelLoadingFutures, EngineCore::Normal, EngineCore::NORMALS_SHADER, EngineCore::ModelAsset::path, primitiveDataFutures, processTextures(), EngineCore::ModelAsset::registerCreatedAssetWithModel(), threadPool, TRACY_ZONE_SCOPED_NAMED_ASSET, TRACY_ZONE_SCOPED_NAMED_D_ASSET, EngineCore::UnpackOptional(), and EngineCore::GltfLoader::StaticMeshExtensions::vulkanSchneeExtension.
Referenced by tick().
|
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.
| modelAsset | The model asset containing the loaded tinygltf::Model |
| modelPath | Path to the glTF file for resolving texture paths |
Definition at line 1133 of file FrameProcessing.cpp.
References assetManager_, EngineCore::TextureHandleRegistry::getOrCreateHandle(), EngineCore::Lightmap, EngineCore::ExrLoader::load(), EngineCore::ModelAsset::model, processTextures(), EngineCore::ModelAsset::registerCreatedAssetWithModel(), renderingDataManager, textureAssetManager, TRACY_ZONE_SCOPED_NAMED, TRACY_ZONE_SCOPED_NAMED_ASSET, and EngineCore::GltfLoader::StaticMeshExtensions::vulkanSchneeExtension.
Referenced by processModel(), and processTextures().
|
inline |
Sets the RenderingDataManager to notify when meshes/materials are loaded.
| rdm | Pointer to the RenderingDataManager |
Definition at line 117 of file FrameProcessing.h.
References renderingDataManager.
| void Ecs::ModelAssetPipeline::submitAsset | ( | const std::filesystem::path & | asset | ) |
Requests the load of a gltf file.
| asset | path to the asset to load. Only use relative paths! |
Definition at line 179 of file FrameProcessing.cpp.
References assetQueue, and modelAssetManager.
|
private |
Definition at line 199 of file FrameProcessing.cpp.
References assetLoaderPool, assetQueue, EngineCore::Path::doesGltfFileExist(), loader, modelLoadingFutures, TRACY_ZONE_SCOPED_NAMED_ASSET, and EngineCore::UnpackOptional().
Referenced by tick().
| std::vector< CompletedMeshletGeneration > Ecs::ModelAssetPipeline::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.
Definition at line 1126 of file FrameProcessing.cpp.
References pendingMeshletCompletions_, and takePendingMeshletCompletions().
Referenced by takePendingMeshletCompletions().
| void Ecs::ModelAssetPipeline::tick | ( | bool | async = true | ) |
Definition at line 191 of file FrameProcessing.cpp.
References processMaterial(), processMeshData(), processModel(), and submitLoadModel().
|
friend |
Definition at line 91 of file FrameProcessing.h.
|
friend |
Definition at line 92 of file FrameProcessing.h.
References assetLoaderPool, materialAssetManager, meshAssetManager, modelAssetManager, and textureAssetManager.
|
private |
Definition at line 167 of file FrameProcessing.h.
Referenced by EngineCore::Engine, ModelAssetPipeline(), processModel(), and submitLoadModel().
|
private |
For TextureHandleRegistry access.
Definition at line 152 of file FrameProcessing.h.
Referenced by ModelAssetPipeline(), processModel(), and processTextures().
|
private |
Definition at line 158 of file FrameProcessing.h.
Referenced by submitAsset(), and submitLoadModel().
|
private |
Definition at line 156 of file FrameProcessing.h.
Referenced by processModel(), and submitLoadModel().
|
private |
Definition at line 148 of file FrameProcessing.h.
Referenced by EngineCore::Engine, ModelAssetPipeline(), processMaterial(), and processModel().
|
private |
Definition at line 160 of file FrameProcessing.h.
Referenced by processMaterial(), and processModel().
|
private |
Definition at line 147 of file FrameProcessing.h.
Referenced by EngineCore::Engine, ModelAssetPipeline(), processMeshData(), and processModel().
|
private |
Definition at line 162 of file FrameProcessing.h.
Referenced by processMeshData().
|
private |
Definition at line 149 of file FrameProcessing.h.
Referenced by EngineCore::Engine, ModelAssetPipeline(), processModel(), and submitAsset().
|
private |
Definition at line 159 of file FrameProcessing.h.
Referenced by processModel(), and submitLoadModel().
|
private |
Definition at line 165 of file FrameProcessing.h.
Referenced by processMeshData(), and takePendingMeshletCompletions().
|
private |
Definition at line 161 of file FrameProcessing.h.
Referenced by processMeshData(), and processModel().
|
private |
Definition at line 151 of file FrameProcessing.h.
Referenced by processMaterial(), processTextures(), and setRenderingDataManager().
|
private |
Definition at line 150 of file FrameProcessing.h.
Referenced by EngineCore::Engine, ModelAssetPipeline(), and processTextures().
|
private |
Definition at line 154 of file FrameProcessing.h.
Referenced by processMeshData(), and processModel().