Skip to content

Latest commit

 

History

History
224 lines (171 loc) · 7.92 KB

ns-d3d11-d3d11_rasterizer_desc.md

File metadata and controls

224 lines (171 loc) · 7.92 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NS:d3d11.D3D11_RASTERIZER_DESC
D3D11_RASTERIZER_DESC (d3d11.h)
Describes rasterizer state. (D3D11_RASTERIZER_DESC)
2dbc005c-d339-7868-c653-8b43d3f9e828
D3D11_RASTERIZER_DESC
D3D11_RASTERIZER_DESC structure [Direct3D 11]
d3d11/D3D11_RASTERIZER_DESC
direct3d11.d3d11_rasterizer_desc
direct3d11\d3d11_rasterizer_desc.htm
direct3d11
53252fef-f557-46d1-b6a7-ccc8a059752a
12/05/2018
2dbc005c-d339-7868-c653-8b43d3f9e828, D3D11_RASTERIZER_DESC, D3D11_RASTERIZER_DESC structure [Direct3D 11], d3d11/D3D11_RASTERIZER_DESC, direct3d11.d3d11_rasterizer_desc
d3d11.h
Windows
Windows
D3D11_RASTERIZER_DESC
19H1
D3D11_RASTERIZER_DESC
d3d11/D3D11_RASTERIZER_DESC
c++
APIRef
kbSyntax
HeaderDef
D3D11.h
D3D11_RASTERIZER_DESC

D3D11_RASTERIZER_DESC structure

-description

Describes rasterizer state.

-struct-fields

-field FillMode

Type: D3D11_FILL_MODE

Determines the fill mode to use when rendering (see D3D11_FILL_MODE).

-field CullMode

Type: D3D11_CULL_MODE

Indicates triangles facing the specified direction are not drawn (see D3D11_CULL_MODE).

-field FrontCounterClockwise

Type: BOOL

Determines if a triangle is front- or back-facing. If this parameter is TRUE, a triangle will be 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, the opposite is true.

-field DepthBias

Type: INT

Depth value added to a given pixel. For info about depth bias, see Depth Bias.

-field DepthBiasClamp

Type: FLOAT

Maximum depth bias of a pixel. For info about depth bias, see Depth Bias.

-field SlopeScaledDepthBias

Type: FLOAT

Scalar on a given pixel's slope. For info about depth bias, see Depth Bias.

-field DepthClipEnable

Type: BOOL

Enable clipping based on distance.

The hardware always performs x and y clipping of rasterized coordinates. When DepthClipEnable is set to the default–TRUE, 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.

-field ScissorEnable

Type: BOOL

Enable scissor-rectangle culling. All pixels outside an active scissor rectangle are culled.

-field MultisampleEnable

Type: BOOL

Specifies whether to use the quadrilateral or alpha line anti-aliasing algorithm on multisample antialiasing (MSAA) render targets. 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.

-field AntialiasedLineEnable

Type: BOOL

Specifies whether to enable line antialiasing; only applies if doing line drawing and MultisampleEnable 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 ID3D11Device::CreateRasterizerState. To set rasterizer state, call ID3D11DeviceContext::RSSetState.

If you do not specify some rasterizer state, the Direct3D runtime uses the following default values for rasterizer state.

State Default Value
FillMode Solid
CullMode Back
FrontCounterClockwise FALSE
DepthBias 0
SlopeScaledDepthBias 0.0f
DepthBiasClamp 0.0f
DepthClipEnable TRUE
ScissorEnable FALSE
MultisampleEnable FALSE
AntialiasedLineEnable FALSE
 
Note  For feature levels 9.1, 9.2, 9.3, and 10.0, if you set MultisampleEnable to FALSE, the runtime renders all points, lines, and triangles without anti-aliasing even for render targets with a sample count greater than 1. For feature levels 10.1 and higher, the setting of MultisampleEnable has no effect on points and triangles with regard to MSAA and impacts only the selection of the line-rendering algorithm as shown in this table:
 
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.

-see-also

Core Structures