D3D10_RASTERIZER_DESC structure (d3d10.h)
Describes the rasterizer state.
Syntax
typedef struct D3D10_RASTERIZER_DESC {
D3D10_FILL_MODE FillMode;
D3D10_CULL_MODE CullMode;
BOOL FrontCounterClockwise;
INT DepthBias;
FLOAT DepthBiasClamp;
FLOAT SlopeScaledDepthBias;
BOOL DepthClipEnable;
BOOL ScissorEnable;
BOOL MultisampleEnable;
BOOL AntialiasedLineEnable;
} D3D10_RASTERIZER_DESC;
Members
FillMode
Type: D3D10_FILL_MODE
A member of the D3D10_FILL_MODE enumerated type that determines the fill mode to use when rendering. The default value is D3D10_FILL_SOLID.
CullMode
Type: D3D10_CULL_MODE
A member of the D3D10_CULL_MODE enumerated type that indicates whether triangles facing the specified direction are drawn. The default value is D3D10_CULL_BACK.
FrontCounterClockwise
Type: BOOL
Determines if a triangle is front-facing or back-facing. If this parameter is TRUE, then a triangle is considered front-facing if its vertices are counter-clockwise on the render target, and considered back-facing if they are clockwise. If this parameter is FALSE, then the opposite is true. The default value is FALSE.
DepthBias
Type: INT
Specifies the depth value added to a given pixel. The default value is 0. For info about depth bias, see Depth Bias.
DepthBiasClamp
Type: FLOAT
Specifies the maximum depth bias of a pixel. The default value is 0.0f. For info about depth bias, see Depth Bias.
SlopeScaledDepthBias
Type: FLOAT
Specifies a scalar on a given pixel's slope. The default value is 0.0f. For info about depth bias, see Depth Bias.
DepthClipEnable
Type: BOOL
Enables or disables clipping based on distance. The default value is TRUE.
The hardware always performs x and y clipping of rasterized coordinates. When DepthClipEnable is set to the default value, the hardware also clips the z value (that is, the hardware performs the last step of the following algorithm).
0 < w
-w <= x <= w (or arbitrarily wider range if implementation uses a guard band to reduce clipping burden)
-w <= y <= w (or arbitrarily wider range if implementation uses a guard band to reduce clipping burden)
0 <= z <= w
When you set DepthClipEnable to FALSE, the hardware skips the z clipping (that is, the last step in the preceding algorithm). However, the hardware still performs the "0 < w" clipping. When z clipping is disabled, improper depth ordering at the pixel level might result. However, when z clipping is disabled, stencil shadow implementations are simplified. In other words, you can avoid complex special-case handling for geometry that goes beyond the back clipping plane.
ScissorEnable
Type: BOOL
Enable or disables scissor-rectangle culling. All pixels outside an active scissor rectangle are culled. The default value is FALSE. For more information, see Set the Scissor Rectangle.
MultisampleEnable
Type: BOOL
Specifies whether to use the quadrilateral or alpha line anti-aliasing algorithm on multisample antialiasing (MSAA) render targets. The default value is FALSE. Set to TRUE to use the quadrilateral line anti-aliasing algorithm and to FALSE to use the alpha line anti-aliasing algorithm. For more info about this member, see Remarks.
AntialiasedLineEnable
Type: BOOL
Specifies whether to enable line antialiasing; only applies when alpha blending is enabled, you are drawing lines, and the MultisampleEnable member is FALSE. The default value is FALSE. For more info about this member, see Remarks.
Remarks
Rasterizer state defines the behavior of the rasterizer stage. To create a rasterizer-state object, call ID3D10Device::CreateRasterizerState. To set rasterizer state, call ID3D10Device::RSSetState.
Line-rendering algorithm | MultisampleEnable | AntialiasedLineEnable |
---|---|---|
Aliased | FALSE | FALSE |
Alpha antialiased | FALSE | TRUE |
Quadrilateral | TRUE | FALSE |
Quadrilateral | TRUE | TRUE |
The settings of the MultisampleEnable and AntialiasedLineEnable members apply only to multisample antialiasing (MSAA) render targets (that is, render targets with sample counts greater than 1). Because of the differences in feature-level behavior and as long as you aren’t performing any line drawing or don’t mind that lines render as quadrilaterals, we recommend that you always set MultisampleEnable to TRUE whenever you render on MSAA render targets.
Requirements
Requirement | Value |
---|---|
Header | d3d10.h |