GiiGaTeam / GiiGaEngine

0 stars 0 forks source link

StaticMeshComponent #69

Open if0ne opened 1 month ago

if0ne commented 1 month ago
PlantUML @startuml class StaticMeshComponent { PSO* PSO MeshID MeshID <> Mesh* Mesh* MaterialID MaterialID <> Material* Material* PerObjectData* PerObjectData void Init() void UpdateGPUData() void GetPerObjectDescs() SortData GetSortData() void Draw() void CreateDynamicMaterialInstance() } class PerObjectData { - bool IsDirty + vector GetDescs() + void UpdateGPUData() } class PSOManager { + PSO* GetPSOfor(MeshID, MaterialID) + PerObjectData* CreatePerObjectDataFor(StaticMeshComponent, isStatic) + Material* CreateDynamicMaterialInstance(MaterialID) } class RuntimeResourceManager { void LoadMesh(MeshID) void LoadMaterial(MaterialID) void ResolveMesh(MeshID) : Mesh* void ResolveMaterial(MaterialID) : Material* } StaticMeshComponent .. PerObjectData StaticMeshComponent "1" *-- "1" PSO : has note as InitNote RRM::LoadMesh(MeshID) Mesh* = ResolveMesh(MeshID) RRM::LoadMaterial(MaterialID) Material* = ResolveMaterial(MaterialID) PSO = PSOManager::GetPSOfor(Mesh*, Material*) PerObjectData* = PSO->CreatePerObjectDataFor(*this, isStatic) end note InitNote .. StaticMeshComponent::Init InitNote .. RuntimeResourceManager InitNote .. PSOManager note as GetSortData GetSortData return {PSO*, Material->GetShaderResource()} end note GetSortData .. StaticMeshComponent::GetSortData GetSortData .. Material note as GetSortDataNoteGetPerObjectDescs UpdateGPUData GetPerObjectDescs end note note as CreateDynamicMaterialInstanceNote CreateDynamicMaterialInstance() Material* = PSOManager::CreateDynamicMaterialInstance(MaterialID) end note CreateDynamicMaterialInstanceNote .. StaticMeshComponent::CreateDynamicMaterialInstance StaticMeshComponent::GetPerObjectDescs .. GetSortDataNoteGetPerObjectDescs GetSortDataNoteGetPerObjectDescs .. PerObjectData @enduml

image