旃麒雅 发表于 2015-5-14 05:11:32

Windows Phone 7 XNA开发之关于图形的配置

  相对于以前的XNA开发,在Windows Phone 7的XNA项目中关于图形的开发有了一些新的变化需要我们关注,否则会出现一些不必要的麻烦。
  我们知道XNA游戏开发可以针对不同的平台进行,比如说Windows Phone 7或Xbox360之类的不同硬件,程现的图形效果有着较大的差距,所以在4.0中就有了profile(配置)。
  配置有两种方式:Reach和HiDef,其中HiDef是针对高端硬件的,比如Xbox360之类的硬件,而Reach则是针对底端硬件,如:Windows Phone 7手机XNA开发的。在Microsoft Visual Studio 2010创建Windows Phone XNA项目时,默认会设置profile为Reach方式而且我们无法选择:
http://img1.iyunv.com/attachment/201203/153407121.jpg
  而在创建Windows或Xbox360的游戏项目后,在项目属性中,可以看到游戏配置是可以修改的:
http://img1.iyunv.com/attachment/201203/153619968.jpg
  有的时候如果在创建一个Windows或xbox360项目后,选用HiDef模式会出现以下错误:
http://img1.iyunv.com/attachment/201203/153955655.png
  “没有找到合适的显卡。
  找不到支持XNA Framework HiDef属性的Direct3D设备。
请验证相应的显卡已经安装。
确认桌面没有被锁定,没有其它的应用程序运行在全屏模式下。
不要在远程桌面下或是做为一个系统服务运行。
  检查显示属性,确认硬件加速已经被设置为完全。”
  因为如果你的项目设置了HiDef配置,但是你的计算机或硬件并不支持Shader model3.0(SM3.0技术是DirectX 9.0C级别显卡全面支持的一项特效)与DirectX 10。那么就会出现以上的错误。
  关于Reach与HiDef的比较:
  
Reach
HiDef
Supported platforms
(支持平台) Windows Phone 7 系列, Xbox 360, 和任何安装有DirectX 9 GPU并支持至少shader model 2.0的Windows PCXbox 360, 和任何安装有DirectX 10 GPU的Windows PCShader model2.0(但是 Windows Phone 不支持自定义shaders)3.0+(Xbox 360 支持自定义shader扩展,例如vfetch, 但不支持Windows)Max texture size
(最大纹理))20484096Max cubemap size
(最大多面体) 5124096Max volume texture size
(最大立体纹理) 不支持256Non power of two texturesConditional: cannot use wrap addressing mode, mipmaps, or DXT compression when the size is not a power of two支持Non power of two cubemaps不支持支持Non power of two volume texturesVolume textures are not supported支持Max primitives per draw call655351048575Index buffer formats
(缓冲索引格式) 16 bit16 和 32 bitVertex element formats
(Vertex元素格式) Color, Byte4, Single, Vector2, Vector3, Vector4, Short2, Short4, NormalizedShort2, NormalizedShort4All of the Reach formats, plus HalfVector2, HalfVector4Texture formats
(纹理格式) Color, Bgr565, Bgra5551, Bgra4444, NormalizedByte2, NormalizedByte4, Dxt1, Dxt3, Dxt5All of the Reach formats, plus Alpha8, Rg32, Rgba64, Rgba1010102, Single, Vector2, Vector4, HalfSingle, HalfVector2, HalfVector4. Floating point texture formats do not support filtering.Vertex texture formats
(Vertex纹理格式) Vertex texturing is not supportedSingle, Vector2, Vector4, HalfSingle, HalfVector2, HalfVector4Render target formats
(渲染目标格式) 部分支持 (见下)部分支持 (见下)Multiple render targets
(多次渲染目标) 不支持Up to 4. Must all have the same bit depth. Supports alpha blending and independent write masks per rendertarget.Occlusion queries不支持支持Separate alpha blend不支持支持Blend.SourceAlphaSaturationOnly for SourceBlend, not DestinationBlend支持Max vertex streams1616Max stream stride255255  
  表格来源:http://blogs.msdn.com/b/shawnhar/archive/2010/03/12/reach-vs-hidef.aspx
页: [1]
查看完整版本: Windows Phone 7 XNA开发之关于图形的配置