issues
search
GiiGaTeam
/
GiiGaEngine
0
stars
0
forks
source link
StaticMeshComponent
#69
Open
if0ne
opened
1 month ago
if0ne
commented
1 month ago
[ ] Mesh Asset
[x]
Texture Asset
is inside Material
[ ] Material Asset
[ ] Это должно рендериться
Implements #86
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
16
LoadMesh(MeshID)
LoadMaterial(MaterialID)
ResolveMesh(MeshID) : Mesh*
ResolveMaterial(MaterialID) : Material*
81
GetPSOfor(MeshID, MaterialID) or ptrs
CreatePerObjectDataFor(StaticMeshComponent, isStatic)
82
UpdateGPUData
GetPerObjectDescs
91
GetShaderResource
98
Draw()
Or We can make like Get Vertex, GetIndex
Texture Assetis inside MaterialPlantUML
@startuml class StaticMeshComponent { PSO* PSO MeshID MeshID <16
81
82
91
98