Add support for depth clamping
This commit is contained in:
@@ -115,6 +115,28 @@ namespace Nz
|
||||
InvalidatePipeline();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Enable/Disable depth clamp for this material
|
||||
*
|
||||
* When enabled, all fragments generated by this material will be clamped to znear or zfar
|
||||
* instead of being clipped out when outside this range.
|
||||
*
|
||||
* This can be useful to prevent clipping near or far primitives.
|
||||
*
|
||||
* \param depthClamp Defines if this material will use depth clamping
|
||||
*
|
||||
* \remark Invalidates the pipeline
|
||||
* \remark Depth clamping requires RenderDeviceFeatures::depthClamping to be true
|
||||
*
|
||||
* \see IsDepthClampEnabled
|
||||
*/
|
||||
inline void Material::EnableDepthClamp(bool depthClamp)
|
||||
{
|
||||
m_pipelineInfo.depthClamp = depthClamp;
|
||||
|
||||
InvalidatePipeline();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Enable/Disable depth sorting for this material
|
||||
*
|
||||
@@ -524,6 +546,15 @@ namespace Nz
|
||||
return m_pipelineInfo.depthBuffer;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Checks whether this material has depth clamping enabled
|
||||
* \return true If it is the case
|
||||
*/
|
||||
inline bool Material::IsDepthClampEnabled() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Checks whether this material has depth sorting enabled
|
||||
* \return true If it is the case
|
||||
|
||||
Reference in New Issue
Block a user