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 |
|---|---|
|
Either technique10 or technique11. Techniques which use functionality new to Direct3D 11 (5_0 shaders, BindInterfaces, etc) must use technique11. | |
|
Optional. An ASCII string that uniquely identifies the name of the effect technique. | |
|
[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). | |
|
Required keyword. | |
|
[in] Optional. An ASCII string that uniquely identifies the name of the pass. | |
|
[in] Set one or more state groups such as: StateGroupSyntax Blend State SetBlendState( arguments ); Depth-stencil State SetDepthStencilState( arguments ); Rasterizer State SetRasterizerState( arguments ); Shader State SetXXXShader( Shader ); SetXXXShader( CompileShader( shader_profile, ShaderFunction( args ) ) ); SetXXXShader( CompileShader( NULL ) ); SetXXXShader( NULL ); SetXXXShader( myShaderVar ); SetXXXShader( myShaderArray[2] ); SetXXXShader( myShaderArray[uIndex] ); SetGeometryShader( ConstructGSWithSO( Shader, strStream0 ) ); SetGeometryShader( ConstructGSWithSO( Shader, strStream0, strStream1, strStream2, strStream3, RastStream ) ); Render Target State One of:
SetRenderTargets( RTV0, DSV ); SetRenderTargets( RTV0, RTV1, DSV ); ... SetRenderTargets( RTV0, RTV1, RTV2, RTV3, RTV4, RTV5, RTV6, RTV7, DSV );
|
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 ) ) );
}
}
Related topics