Windows Phone 自定义着色器错误?

发布于 2024-12-11 19:32:15 字数 268 浏览 0 评论 0原文

在 Windows Phone XNA 4.0 中,我在编译时收到以下错误:Windows Phone 平台不支持自定义着色器

这真的很烦人,因为我有一个 Xbox 360 版本的项目,还有一个 Windows 版本的项目。

我尝试使用基于编译的 #if !WINDOWS_PHONE#endif,但没有成功。似乎忽略了这一点。

如何在 Windows Phone 项目中编译时排除或忽略此文件?

In Windows Phone XNA 4.0, I am receiving the following error when compiling: the windows phone platform does not support custom shaders.

This is really annoying, because I have an Xbox 360 version of the project, and a Windows version of the project as well.

I tried using the compilation based #if !WINDOWS_PHONE and #endif, but with no luck. It seems as if it ignores this.

How can I make this file be excluded or ignored when compiled in the Windows Phone project?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

将军与妓 2024-12-18 19:32:16

只是猜测,但您可以使用 #ifndef WINDOWS_PHONE 代替吗?

Just a guess, but can you use #ifndef WINDOWS_PHONE instead?

圈圈圆圆圈圈 2024-12-18 19:32:15

作为解决方法,您可以:

  • 为 WP7 和 Xbox 创建单独的游戏和内容项目
  • 在 WP7 上手动将“构建操作”从“编译”切换为“无”(仅适用于受虐狂)
  • 由于资产构建操作是在 .contentproj 中定义的文件,您可以有它的 2 个版本,或者编写一个修改它的脚本(并且该脚本可能会作为编译过程的一部分自动运行),

因为您可能还想在与您在 Xbox 上使用的 WP7 相比,我只需为 WP7 和 Xbox 创建单独的游戏和内容项目,并将通用游戏代码移至库中。

哦,请告诉我您是否知道如何根据解决方案配置等选择不同的内容项目,以便不需要单独的游戏项目:)

As a workaround, you could:

  • Create separate game and content projects for WP7 and Xbox
  • Manually switching the 'Build Action' from 'Compile' to 'None' on WP7 (for masochists only)
  • Since the asset build actions are defined in the .contentproj file, you could have 2 versions of it or write a script that modifies it (and the script could probably be run as a part of the compilation process automatically)

Since you might also want to use smaller textures etc. on WP7 than you are using on Xbox, I'd just create separate game and content projects for WP7 and Xbox and move the common game code to a library.

Oh, and tell me if you figure how to select a different content project based on, e.g., the solution configuration so that the separate game project is not needed :)

じее 2024-12-18 19:32:15

Windows Phone 7 上不支持 XNA 游戏的自定义着色器,但我不知道 SilverLight 的任何功能。

但是,有几种可以在 XNA 中使用的内置效果:

•SkinnedEffect

•EnvironmentMapEffect

•DualTextureEffect

•AlphaTestEffect

针对 XNA Reach 配置文件的游戏将是跨平台的,因为 Reach 配置文件包含以下元素:在 XNA 的所有实现中共享。要使用更高级的选项,需要以 Hi-Def 配置文件为目标。但 Hi-Def 与 Windows Phone 不兼容。

Custom shaders for XNA games, on Windows Phone 7, are not supported, but I don't know about any capabilities for SilverLight.

There are several built in effects that can be used in XNA however:

•SkinnedEffect

•EnvironmentMapEffect

•DualTextureEffect

•AlphaTestEffect

Games that target the XNA Reach profile are going to be cross platform as the Reach profile contains elements that are shared across all implementations of XNA. To use more advanced options the Hi-Def profile would need to be targetted. But Hi-Def doesn't have compatibility with Windows Phone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文