namespace MoonWorks.Graphics
{
///
/// Determines how data is written to and read from the depth/stencil buffer.
///
public struct DepthStencilState
{
///
/// If disabled, no depth culling will occur.
///
public bool DepthTestEnable;
///
/// Describes the stencil operation.
///
public StencilOpState StencilState;
///
/// The comparison operator used in the depth test.
///
public CompareOp CompareOp;
///
/// If depth lies outside of these bounds the pixel will be culled.
///
public bool DepthBoundsTestEnable;
///
/// Specifies whether depth values will be written to the buffer during rendering.
///
public bool DepthWriteEnable;
///
/// The minimum depth value in the depth bounds test.
///
public float MinDepthBounds;
///
/// The maximum depth value in the depth bounds test.
///
public float MaxDepthBounds;
///
/// If disabled, no stencil culling will occur.
///
public bool StencilTestEnable;
public static readonly DepthStencilState DepthReadWrite = new DepthStencilState
{
DepthTestEnable = true,
DepthWriteEnable = true,
DepthBoundsTestEnable = false,
StencilTestEnable = false,
CompareOp = CompareOp.LessOrEqual
};
public static readonly DepthStencilState DepthRead = new DepthStencilState
{
DepthTestEnable = true,
DepthWriteEnable = false,
DepthBoundsTestEnable = false,
StencilTestEnable = false,
CompareOp = CompareOp.LessOrEqual
};
public static readonly DepthStencilState Disable = new DepthStencilState
{
DepthTestEnable = false,
DepthWriteEnable = false,
DepthBoundsTestEnable = false,
StencilTestEnable = false
};
}
}