Graphics/Material: Add EnableVertexColor temporary

This commit is contained in:
Jérôme Leclercq
2018-06-15 14:13:18 +02:00
parent b2185f2138
commit 41e2d3e448
5 changed files with 34 additions and 1 deletions

View File

@@ -392,6 +392,25 @@ namespace Nz
InvalidatePipeline();
}
/*!
* \brief Enable/Disable vertex coloring on this material
*
* This is a temporary option, until the new material pipeline system is ready, allowing to enable vertex coloring.
* This option only works with meshes using vertex colors.
*
* \param vertexColor Defines if this material will use vertex color or not
*
* \remark Invalidates the pipeline
*
* \see HasVertexColor
*/
inline void Material::EnableVertexColor(bool vertexColor)
{
m_pipelineInfo.hasVertexColor = vertexColor;
InvalidatePipeline();
}
/*!
* \brief Ensures the pipeline gets updated
*
@@ -756,6 +775,15 @@ namespace Nz
return m_specularMap.IsValid();
}
/*!
* \brief Checks whether this material uses vertex coloring
* \return true If it is the case
*/
inline bool Material::HasVertexColor() const
{
return m_pipelineInfo.hasVertexColor;
}
/*!
* \brief Checks whether this material has alpha test enabled
* \return true If it is the case