Effect Group Syntax (Direct3D 11)

An effect group is declared with the syntax described in this section.

fxgroup GroupName  [ <Annotations > ]
{
    TechniqueVersion TechniqueName [ <Annotations > ] 
    { 
       ...
    } 
    TechniqueVersion TechniqueName [ <Annotations > ] 
    { 
       ...
    } 
}



Parameters

Item Description
fxgroup
required keyword.
GroupName
Required. An ASCII string that uniquely identifies the name of the effect group. Unlike techniques, groups must have names to ensure that techniques have a unique identifier (see Groups and Techniques section below).
< 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).
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.

Groups and Techniques

In order to maintain compatibility with fx_4_0 effects, groups are optional. There is an implicit NULL-named group surrounding all global techniques.

Consider the following example:

technique11 GlobalTech
{
}
fxgroup Group1
{
     technique11 Tech1 { ... }
     technique11 Tech2 { ... }
}
fxgroup Group2
{
     technique11 Tech1 { ... }
     technique11 Tech2 { ... }
}

In C++, one can get a technique by name in two ways. The following commands will find the obvious techniques:

pEffect->GetTechniqueByName( "GlobalTech" );
pEffect->GetTechniqueByName( "|GlobalTech" );
pEffect->GetTechniqueByName( "Group1|Tech1" );
pEffect->GetTechniqueByName( "Group1|Tech2" );
pEffect->GetTechniqueByName( "Group2|Tech1" );
pEffect->GetTechniqueByName( "Group2|Tech2" );
pEffect->GetGroupByName("Group1")->GetTechniqueByName( "Tech1" );
pEffect->GetGroupByName("Group1")->GetTechniqueByName( "Tech2" );
pEffect->GetGroupByName("Group2")->GetTechniqueByName( "Tech1" );
pEffect->GetGroupByName("Group2")->GetTechniqueByName( "Tech2" );

In order to ensure that ID3DX11Effect::GetTechniqueByName works similarly to Effects 10, all defined groups must have a name.

Effect Format

Effect Technique Syntax (Direct3D 11)