Graphics Reference
In-Depth Information
the output render targets. This stage object is created with the ID3DllDevice:: Create
BlendState() method, which takes a pointer to a description structure that specifies what
configuration the state object will represent. Listing 3.26 shows the contents of the blend
state description.
Struct D3D11_BLEND_DESC {
BOOL AlphaToCoverageEnable;
BOOL IndependentBlendEnable;
D3D11_RENDER_TARGET_BLEND_DESC Render-Target[8];
}
Listing 3.26. The D3D11_BLEND_DESC structure and its members.
The first parameter determines if the alpha value of the output color will be used to
determine the subsample coverage instead of the rasterizer coverage values, or the SV_
Coverage system value semantic if the pixel shader writes to it. This can be used to imple-
ment a form of transparent rendering without needing to first sort the objects in the scene.
The second and third members of this structure are used in conjunction with one another.
The IndependentBlendEnable parameter indicates if there will be a separate blending
mode specified for each render target when multiple render targets are used. If the param-
eter is true, each of the eight elements in the RenderTarget array provides the blending
state for its respective render target. If independent blend is false, the element at index 0
will be used for all render targets. Once the blend state object has been created, it is bound
to the pipeline through the device context with the ID3DllDeviceContext: :OMSetBlend
State() method. And as always, there is a corresponding get method to retrieve the state
currently bound to the pipeline. We will explore the details of the blending configurations
in the "Output Merger Stage Processing" section.
RenderTarget State
The render target state of the output merger represents the actual resources that receive
the results of all the rendering calculations performed throughout the pipeline. A relatively
large number of different configurations can be used to receive this output, and of course
there are also restrictions on what combinations of render targets can be used together. We
will begin by discussing the various types of render targets that can be bound to the output
merger and then see how they are manipulated by the application.
The output merger has eight render target slots and one depth stencil slot. Each render
target is bound to the pipeline through a render target view (RTV), and the depth stencil tar-
get is bound through a depth stencil view (DSV). In a traditional rendering configuration, a
single render target is bound with a single depth target. However, this is not a requirement.
Search WWH ::




Custom Search