Components/GraphicsComponent: Watch every used material to handle reflective information

This commit is contained in:
Lynix
2017-03-28 23:36:08 +02:00
parent 5b236ab09a
commit 6851428c3c
5 changed files with 163 additions and 57 deletions

View File

@@ -124,10 +124,15 @@ namespace Nz
{
NazaraAssert(skinIndex < m_skinCount, "Skin index out of bounds");
m_skin = skinIndex;
if (m_skin != skinIndex)
{
OnInstancedRenderableSkinChange(this, skinIndex);
// Force render queue invalidation
InvalidateInstanceData(0);
m_skin = skinIndex;
// Force render queue invalidation
InvalidateInstanceData(0);
}
}
/*!
@@ -186,6 +191,8 @@ namespace Nz
{
NazaraAssert(skinCount != 0, "Invalid skin count (cannot be zero)");
OnInstancedRenderableResetMaterials(this, matCount);
m_materials.clear();
m_materials.resize(matCount * skinCount, Material::GetDefault());