Export (0) Print
Expand All
End
Map
Expand Minimize

ID3D11DeviceContext::OMSetBlendState method

Set the blend state of the output-merger stage.

Syntax


void OMSetBlendState(
  [in]  ID3D11BlendState *pBlendState,
  [in]  const FLOAT BlendFactor[4],
  [in]  UINT SampleMask
);

Parameters

pBlendState [in]

Type: ID3D11BlendState*

Pointer to a blend-state interface (see ID3D11BlendState). Pass NULL for a default blend state. For more info about default blend state, see Remarks.

BlendFactor[4] [in]

Type: const FLOAT

Array of blend factors, one for each RGBA component. The blend factors modulate values for the pixel shader, render target, or both. If you created the blend-state object with D3D11_BLEND_BLEND_FACTOR or D3D11_BLEND_INV_BLEND_FACTOR, the blending stage uses the non-NULL array of blend factors. If you didn't create the blend-state object with D3D11_BLEND_BLEND_FACTOR or D3D11_BLEND_INV_BLEND_FACTOR, the blending stage does not use the non-NULL array of blend factors; the runtime stores the blend factors, and you can later call ID3D11DeviceContext::OMGetBlendState to retrieve the blend factors. If you pass NULL, the runtime uses or stores a blend factor equal to { 1, 1, 1, 1 }.

SampleMask [in]

Type: UINT

32-bit sample coverage. The default value is 0xffffffff. See remarks.

Return value

Returns nothing.

Remarks

Blend state is used by the output-merger stage to determine how to blend together two RGB pixel values and two alpha values. The two RGB pixel values and two alpha values are the RGB pixel value and alpha value that the pixel shader outputs and the RGB pixel value and alpha value already in the output render target. The blend option controls the data source that the blending stage uses to modulate values for the pixel shader, render target, or both. The blend operation controls how the blending stage mathematically combines these modulated values.

To create a blend-state interface, call ID3D11Device::CreateBlendState.

Passing in NULL for the blend-state interface indicates to the runtime to set a default blending state. The following table indicates the default blending parameters.

StateDefault Value
AlphaToCoverageEnableFALSE
IndependentBlendEnableFALSE
RenderTarget[0].BlendEnableFALSE
RenderTarget[0].SrcBlendD3D11_BLEND_ONE
RenderTarget[0].DestBlendD3D11_BLEND_ZERO
RenderTarget[0].BlendOpD3D11_BLEND_OP_ADD
RenderTarget[0].SrcBlendAlphaD3D11_BLEND_ONE
RenderTarget[0].DestBlendAlphaD3D11_BLEND_ZERO
RenderTarget[0].BlendOpAlphaD3D11_BLEND_OP_ADD
RenderTarget[0].RenderTargetWriteMaskD3D11_COLOR_WRITE_ENABLE_ALL

 

A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

Windows Phone 8: This API is supported.

Requirements

Header

D3D11.h

Library

D3D11.lib

See also

ID3D11DeviceContext

 

 

Community Additions

ADD
Show:
© 2014 Microsoft