Silverlight 像素着色器资源“未找到”; URI 应该是什么?
因此,我使用 Shazzam 编写并编译了一个 HLSL 像素着色器,将生成的 .ps 文件放入我的项目中,并尝试实例化它。无论我输入什么 URI,Blend 都会告诉我,每当我尝试查看任何 xaml 设计器时都找不到该资源,而 Visual Studio 只会在设计视图中以及在我尝试运行应用程序时向我显示一个空白页面。
这是一个 Silverlight 4 SketchFlow 项目,在 Blend 4 RC 和 Visual Studio 2010 中。
我已经尝试使用 Resource 和 EmbeddedResource 作为 .ps 文件的构建操作,两者都没有任何区别(我很确定它应该被设置)到资源)。
我尝试了以下 URI 格式:
"ShaderFileName.ps"
"/ShaderFileName.ps"
"AssemblyName;component/ShaderFileName.ps"
"/AssemblyName;component/ShaderFileName.ps"
我还尝试将着色器文件从 Screens 程序集移动到根程序集(这就是创建 SketchFlow 项目的方式),但这也没有帮助。
有人有什么想法吗?
So I've written and compiled an HLSL pixel shader with Shazzam, placed the resulting .ps file in my project, and am trying to instantiate it. No matter what URI I put, Blend tells me that the resource can't be found whenever I try to view any xaml designer, and Visual Studio just shows me a blank page, both in design view and if I try to run the application.
This is a Silverlight 4 SketchFlow project, in Blend 4 RC and Visual Studio 2010.
I've tried both Resource and EmbeddedResource as the Build Action for the .ps file, neither make any difference (I'm pretty sure it's supposed to be set to Resource).
I've tried the following URI formats:
"ShaderFileName.ps"
"/ShaderFileName.ps"
"AssemblyName;component/ShaderFileName.ps"
"/AssemblyName;component/ShaderFileName.ps"
I also tried moving the shader file from the Screens assembly to the root assembly (that's how SketchFlow projects are created) and that didn't help either.
Anyone have any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个。它对我有用:
Try this. It works for me:
BuildAction=资源正确,格式为:
“程序集名称;组件/ShaderFileName.ps”
如果着色器 .ps 文件位于文件夹内,请不要忘记添加相对路径。还要检查拼写。
BuildAction=Resource is right and the format is:
"AssemblyName;component/ShaderFileName.ps"
Don't forget to add the relative path if the shader .ps file is located inside a folder. Also check the spelling.
BuildAction=内容和路径,如“/ShaderFileName.ps”(如果将其放在应用程序的根目录中)
BuildAction=Content and path like "/ShaderFileName.ps" if you put it in root of your app