HLSL declaring a pass with angle brackets containing values
In the directx post process sample the downfilter FX has the following code in it:
//-----------------------------------------------------------------------------
// Technique: PostProcess
// Desc: Performs post-processing effect that down-filters.
//-----------------------------------------------------------------------------
technique PostProcess
{
pass p0
<
float fScaleX = 0.25f;
float fScaleY = 0.25f;
>
{
VertexShader = null;
PixelShader = compile ps_2_0 DownFilter();
ZEnable = false;
}
}
I'm just curious, the pass is declared with angle bracket开发者_StackOverflows and those two float values. What does it do exactly?
The items in the angle brackets are annotations:
"user-supplied information (metadata) that is ignored by the effect system" [ http://msdn.microsoft.com/en-us/library/ee415626%28VS.85%29.aspx ]
The nVidia article on Using Annoations and Semantics is also a good read for this.
精彩评论