Graphics/Material: Add SetReflectionMode

This commit is contained in:
Lynix
2017-03-19 17:01:48 +01:00
parent 62fd66a159
commit 65393d98fb
3 changed files with 53 additions and 0 deletions

View File

@@ -618,6 +618,18 @@ namespace Nz
return m_pipelineInfo.pointSize;
}
/*!
* \brief Gets the reflection mode of the material
*
* \return Current reflection mode
*
* \see SetReflectionMode
*/
inline ReflectionMode Material::GetReflectionMode() const
{
return m_reflectionMode;
}
/*!
* \brief Gets the über-shader used by this material
* \return Constant pointer to the über-shader used
@@ -1243,6 +1255,34 @@ namespace Nz
InvalidatePipeline();
}
/*!
* \brief Changes reflection mode of the material
*
* When reflections are enable, the material will render reflections from the object environment according to the reflection mode.
* This function does change the reflection mode used by the material.
*
* Skyboxes reflections are the cheapest but are static and thus can't reflect other objects.
* Probes reflections are cheap, depending on probes reflection mode, but require regular probe finding from objects using it.
* Real-time reflections are expensive but provide the most accurate reflection map (and can reflect other objects around).
*
* \param reflectionMode The new reflection mode this material should use
*
* \remark May invalidates the pipeline
*
* \see EnableReflectionMapping
* \see IsReflectionMappingEnabled
* \see SetReflectionSize
*/
inline void Material::SetReflectionMode(ReflectionMode reflectionMode)
{
if (m_reflectionMode != reflectionMode)
{
OnMaterialReflectionChange(this, reflectionMode);
m_reflectionMode = reflectionMode;
}
}
/*!
* \brief Sets the shader with a constant reference to a ubershader
*