Add support for depth clamping
This commit is contained in:
@@ -42,6 +42,7 @@ namespace Nz
|
||||
inline void EnableBlending(bool blending);
|
||||
inline void EnableColorWrite(bool colorWrite);
|
||||
inline void EnableDepthBuffer(bool depthBuffer);
|
||||
inline void EnableDepthClamp(bool depthClamp);
|
||||
inline void EnableDepthSorting(bool depthSorting);
|
||||
inline void EnableDepthWrite(bool depthWrite);
|
||||
inline void EnableFaceCulling(bool faceCulling);
|
||||
@@ -84,6 +85,7 @@ namespace Nz
|
||||
inline bool IsBlendingEnabled() const;
|
||||
inline bool IsColorWriteEnabled() const;
|
||||
inline bool IsDepthBufferEnabled() const;
|
||||
inline bool IsDepthClampEnabled() const;
|
||||
inline bool IsDepthSortingEnabled() const;
|
||||
inline bool IsDepthWriteEnabled() const;
|
||||
inline bool IsFaceCullingEnabled() const;
|
||||
|
||||
@@ -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