Export (0) Print
Expand All

Effect State Groups (Direct3D 10)

Effect states are name value pairs in the form of an expression.

Blend State

ALPHATOCOVERAGEENABLE

BLENDENABLE

SRCBLEND

DESTBLEND

BLENDOP

SRCBLENDALPHA

DESTBLENDALPHA

BLENDOPALPHA

RENDERTARGETWRITEMASK
Members of D3D10_BLEND_DESC

 

Depth and Stencil State

DEPTHENABLE

DEPTHWRITEMASK

DEPTHFUNC

STENCILENABLE

STENCILREADMASK

STENCILWRITEMASK
Members of D3D10_DEPTH_STENCIL_DESC
FRONTFACESTENCILFAIL

FRONTFACESTENCILZFAIL

FRONTFACESTENCILPASS

FRONTFACESTENCILFUNC

BACKFACESTENCILFAIL

BACKFACESTENCILZFAIL

BACKFACESTENCILPASS

BACKFACESTENCILFUNC
Member of D3D10_DEPTH_STENCILOP_DESC

 

Rasterizer State

FILLMODE D3D10_FILL_MODE
CULLMODE D3D10_CULL_MODE
FRONTCOUNTERCLOCKWISE

DEPTHBIAS

DEPTHBIASCLAMP

SLOPESCALEDDEPTHBIAS

ZCLIPENABLE

SCISSORENABLE

MULTISAMPLEENABLE

ANTIALIASEDLINEENABLE
Members of D3D10_RASTERIZER_DESC

 

Sampler State

Filter

AddressU

AddressV

AddressW

MipLODBias

MaxAnisotropy

ComparisonFunc

BorderColor

MinLOD

MaxLOD
Members of D3D10_SAMPLER_DESC

 

See Sampler Type (DirectX HLSL) for examples.

Effect Object State

This Effect ObjectMaps to
RASTERIZERSTATEA Rasterizer State state object.
DEPTHSTENCILSTATEA Depth and Stencil State state object.
BLENDSTATEA Blend State state object.
VERTEXSHADERA compiled vertex shader object.
PIXELSHADERA compiled pixel shader object.
GEOMETRYSHADERA compiled geometry shader object.
DS_STENCILREF

AB_BLENDFACTOR

AB_SAMPLEMASK
Members of D3D10_PASS_DESC.

 

Defining and using state objects

State objects are declared in FX files in the following format. StateObjectType is one of the states listed above and MemberName is the name of any member that will have a non-default value.



StateObjectType ObjectName {
  MemberName = value;
  ...
  MemberName = value;
};
    

For example, to set up a blend state object with AlphaToCoverageEnable and BlendEnable[0] set to FALSE the following code would be used.



BlendState NoBlend {
  AlphaToCoverageEnable = FALSE;
  BlendEnable[0] = FALSE;
};
    

The state object is applied to a technique pass using one of the SetStateGroup functions described in Effect Technique Syntax (Direct3D 10). For example, to apply the BlendState object described above the following code would be used.



SetBlendState( NoBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
    

For a tutorial describing the use of states see State Management.

Related topics

Effect Format (Direct3D 10)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft