wpf 支持除 TEXCOORD 之外的任何着色器输入
我知道您可以将常量寄存器绑定到依赖属性,也可以将画笔绑定到采样器,但是我见过的 wpf 着色器的每个示例都使用声明
main( float2 uv : TEXCOORD ) : COLOR
我是 HLSL 的完全新手但我知道除了 TEXCOORD 之外还有其他语义。它们中的任何一个都可以与 WPF 着色器一起使用吗?
同样,除了语义 COLOR 之外,是否还可以使用任何有效的返回值?
或者语义只是对用户的“提醒”,WPF 将运行它收到的任何着色器,就好像它具有 TEXCOORD 输入和 COLOR 输出一样(并且会在 float4 或 struct 输入上阻塞)?
I know that you can tie constant registers to dependency properties as well as tie a brush to a sampler, but every example I have seen of a wpf shader uses the declaration
main( float2 uv : TEXCOORD ) : COLOR
I am a complete newbie to HLSL but I know there are other semantics than TEXCOORD. Can any of them be used with a WPF shader?
Similarly are there any valid returns that can be used other than the semantic COLOR?
Or are the semantics just "reminders" to the user and WPF will run whatever shader it receives as if it has TEXCOORD inputs and a COLOR output regardless (and will choke on a float4 or struct input)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据优秀的教程Greg Schechter,WPF 仅支持具有该签名的 main 方法。虽然这是在 PS3 支持之前编写的,但我认为这方面没有任何改变。
According to the excellent tutorial by Greg Schechter, WPF only supports a main method with that signature. Although that was written before PS3 support, I don't think anything has changed in this regard.