Effect Technique Syntax (Direct3D 11)
An effect technique is declared with the syntax described in this section.
TechniqueVersion TechniqueName [ <Annotations > ]
{
- pass *PassName* \[ <*Annotations* > \]
{
- \[ *SetStateGroup*; \] \[ *SetStateGroup*; \]
...
\[ *SetStateGroup*; \]
}
Parameters
Item | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TechniqueVersion |
Either technique10 or technique11. Techniques which use functionality new to Direct3D 11 (5_0 shaders, BindInterfaces, etc) must use technique11. |
||||||||||||||||||
TechniqueName |
Optional. An ASCII string that uniquely identifies the name of the effect technique. |
||||||||||||||||||
<Annotations > |
[in] Optional. One or more pieces of user-supplied information (metadata) that is ignored by the effect system. For syntax, see Annotation Syntax (Direct3D 11). |
||||||||||||||||||
pass |
Required keyword. |
||||||||||||||||||
PassName |
[in] Optional. An ASCII string that uniquely identifies the name of the pass. |
||||||||||||||||||
SetStateGroup |
[in] Set one or more state groups such as:
|
Examples
This example sets blending state.
BlendState NoBlend
{
BlendEnable[0] = False;
};
...
technique10
{
pass p2
{
...
SetBlendState( NoBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
}
}
This example sets up the rasterizer state to render an object in wireframe.
RasterizerState rsWireframe { FillMode = WireFrame; };
...
technique10
{
pass p1
{
....
SetRasterizerState( rsWireframe );
}
}
This example sets shader state.
technique10 RenderSceneWithTexture1Light
{
pass P0
{
SetVertexShader( CompileShader( vs_4_0, RenderSceneVS( 1, true, true ) ) );
SetGeometryShader( NULL );
SetPixelShader( CompileShader( ps_4_0, RenderScenePS( true ) ) );
}
}