Refactor material system (#382)

This commit is contained in:
Jérôme Leclercq
2022-10-31 19:53:41 +01:00
committed by GitHub
parent 0a8048809c
commit dc6ce8427c
156 changed files with 3633 additions and 4569 deletions

View File

@@ -13,14 +13,14 @@ namespace Nz
return m_submeshes.size();
}
inline void Model::SetMaterial(std::size_t subMeshIndex, std::shared_ptr<Material> material)
inline void Model::SetMaterial(std::size_t subMeshIndex, std::shared_ptr<MaterialInstance> material)
{
assert(subMeshIndex < m_submeshes.size());
assert(material);
if (m_submeshes[subMeshIndex].material != material)
{
OnMaterialInvalidated(this, 0, material);
OnMaterialInvalidated(this, subMeshIndex, material);
m_submeshes[subMeshIndex].material = std::move(material);
OnElementInvalidated(this);