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 back-face stencil operation.
///
public StencilOpState BackStencilState;
///
/// Describes the front-face stencil operation.
///
public StencilOpState FrontStencilState;
///
/// The compare mask for stencil ops.
///
public uint CompareMask;
///
/// The write mask for stencil ops.
///
public uint WriteMask;
///
/// The stencil reference value.
///
public uint Reference;
///
/// 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
};
}
}