HLSL 使用包含值的尖括号声明传递
在 directx 后处理示例中,下滤波器 FX 包含以下代码:
//-----------------------------------------------------------------------------
// 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;
}
}
我只是好奇,该通道是用尖括号和这两个浮点值声明的。它到底有什么作用?
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 brackets and those two float values. What does it do exactly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尖括号中的项目是注释:
“效果系统忽略的用户提供的信息(元数据)” [ http://msdn.microsoft.com/en-us/library/ee415626%28VS.85%29.aspx]
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 ]
nVidia 关于使用注释和语义的文章也是一本很好的读物。
The nVidia article on Using Annoations and Semantics is also a good read for this.