Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID3D10Device::OMSetBlendState method

Set the blend state of the output-merger stage.

Syntax


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

Parameters

pBlendState [in]

Type: ID3D10BlendState*

Pointer to a blend-state interface (see ID3D10BlendState). Passing in NULL implies a default blend state. See remarks for further details.

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 D3D10_BLEND_BLEND_FACTOR or D3D10_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 D3D10_BLEND_BLEND_FACTOR or D3D10_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 ID3D10Device::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
BlendEnableFALSE[8]
SrcBlendD3D10_BLEND_ONE
DstBlendD3D10_BLEND_ZERO
BlendOpD3D10_BLEND_OP_ADD
SrcBlendAlphaD3D10_BLEND_ONE
DstBlendAlphaD3D10_BLEND_ZERO
BlendOpAlphaD3D10_BLEND_OP_ADD
RenderTargetWriteMask[8]D3D10_COLOR_WRITE_ENABLE_ALL[8]

 

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 not hold a reference to the interfaces passed in. For that reason, applications should be careful not to release an interface currently in use by the device.

Requirements

Header

D3D10.h

Library

D3D10.lib

See also

ID3D10Device Interface

 

 

Community Additions

Show:
© 2014 Microsoft. All rights reserved.