Shawn Hargreaves Blog
When you create a Windows Phone game project, XNA defaults to Reach profile. When you create a Windows or Xbox 360 project, it defaults to HiDef. But it is also possible to target Reach from a Windows or Xbox game! There are two reasons you might want to do this:
To use Reach on Windows or Xbox:
You can also choose profiles at runtime, by setting GraphicsDeviceManager.GraphicsProfile from your Game constructor. It is usually better to specify this via the project properties, though.
Hehe, if you speak of the devil. I was just figuring out why my shaders refused to compile with the error "XNA Framework Reach profile does not support vertex shader model 3.0". An odd thing though: when I fixed that by following this blog post, they still refused to compile as the shader compiler didn't like me naming a pixelshader 'PixelShader'. When I renamed it 'PS', it compiled.
What's the best way to fallback to Reach if HiDef isn't supported? Can we build assets using Reach even when the rest of the game is built with HiDef, and then at runtime detect if HiDef isn't supported and switch to Reach?
Maybe an "opt-in" approach would work better than an "opt-out." So you build the game with Reach, then at runtime determine if HiDef is supported, and if it is switch to HiDef.
> the shader compiler didn't like me naming a pixelshader 'PixelShader'
Correct. 'PixelShader' is a reserved word in HLSL, so you can't use this for your own symbol names.
> What's the best way to fallback to Reach if HiDef isn't supported?
Write code in your game constructor that checks which profile the adapter supports and sets GraphicsDeviceManager.GraphicsProfile accordingly.
If all your content fits into Reach rules, you can build everything for Reach.
If you have some content that needs to be built only for HiDef, you will need to make one more more library projects, so you can split the content up, building one library for Reach and the other for HiDef.
I know this probably isn't the correct place to ask this, but I'm getting the same error that JulianR was, except that when I follow both directions, I'm still receiving the error that vertex shader model 3.0 isn't supported. In this version of the beta, is it possible to set the content project to just ignore them if building for a certain platform or even conditionally build techniques based on their version? My project used to work perfectly until this version of the beta :|
The error "XNA Framework Reach profile does not support vertex shader model 3.0" means that the Content Pipeline is building using Reach, not HiDef. Make sure you have changed this in the project properties for whichever project contains the content that is giving this error. If that content is built by a game library, you need to set this on the library itself, not just the game that references that library.
Is there a place on line I can look a bit more into this? My VS seems to be quite stubborn on using Reach no matter what I tell it to do :)
Ray: you can manually inspect your project XML files to see for sure what settings are stored in them. Also if you upgraded from an earlier CTP, try recreating new projects to make sure you don't have any legacy CTP stuff getting in the way.
Thanks for the help! I had to recreate the CTP instead of upgrading from the previous one! I owe you ten internets :)
> Correct. 'PixelShader' is a reserved word in HLSL, so you can't use this for your own symbol names.
Figured as much, it's just that they compiled just fine under XNA 3.0, so I was a little surprised :)
How can I get a project that uses shader model 3.0 to run on a GPU that doesn't support DX10? With HiDef selected, XNA tells me my GPU (Geforce 7600 GT) isn't supported and with Reach selected it tells me shader model 3.0 isn't supported. The same project worked perfectly with XNA 3.1.
> How can I get a project that uses shader model 3.0 to run on a GPU that doesn't support DX10?
The short answer is you cannot. XNA 4 has only two graphics feature levels: Reach and HiDef. If your card does not support HiDef, you will only be able to run Reach games on it, which means you cannot use any HiDef features (such as shader model 3).
One of the costs of simplifying the hardware caps matrix is less flexibility when it comes to hardware that falls in the gaps between our feature levels. Fortunately, though, the install base of shader model 3 DX9 GPUs (which lie in between Reach and HiDef) is now quite small, and shrinking all the time...
If you want to make a HiDef game with GS4, you will have to upgrade to a more recent GPU.
do you have any sample code for point sprites in reach & hidef?
> do you have any sample code for point sprites in reach & hidef?
Game Studio 4.0 does not support point sprites at all (see blogs.msdn.com/.../point-sprites-in-xna-game-studio-4-0.aspx for details), so no, no sample code for them.