Windows Phone custom shaders error?
Asked Answered
O

3

3

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?

Oldwife answered 26/10, 2011 at 19:25 Comment(0)
B
2

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 :)

Bobbi answered 31/10, 2011 at 15:5 Comment(0)
R
2

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.

Rafaelita answered 30/10, 2011 at 18:17 Comment(0)
B
2

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 :)

Bobbi answered 31/10, 2011 at 15:5 Comment(0)
O
0

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

Outthink answered 26/10, 2011 at 19:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.