Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am a beginner to game development and as I am used to programming in C# I decided to go for XNA. I've been playing around with it for a while and now I am learning the basics of HLSL shaders, I have noticed in the MSDN documentation that there have been some syntax changes in HLSL between DirectX 9 and DirectX 10, for example, the Sampler type

Since I am having some troubles with my desktop pc, I am using my laptop which video card only supports DirectX 9.0c. Then I'm gonna have to write my shaders using the DirectX 9 syntax, right? So I am wondering, will my HLSL shaders written using the DirectX 9 syntax work on a system running DirectX 10 (or higher)?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

XNA uses Direct3D 9 under the hood, and D3D9 only supports up to shader model 3, so (I could be wrong though) you can only use shader model 1, 2 or 3 with XNA. D3D9 will work on all D3D9 or higher enabled GPUs, so you can safely write some shader model 3 HLSL code for XNA.

On the other hand I'm not sure about the xbox. I think the xbox supports shader model 3.0, but I'm not sure, and I think it has a few specific functionality. But in general when using XNA, if it compiles, it should run fine on PC + xbox.

share|improve this answer
    
Thank you dotminic –  Delta Mar 3 '11 at 18:09
    
-1. It sounds like you don't really know what you are talking about. XNA has Reach(dx9) and HD(dx10). You can use up to SM4 if you use HD. Xbox 360 supports SM3.5 . If it compiles on the PC using HD, it wont work on the 360 at all. If it compiles on the PC, lots of things can prevent it from running on the 360, high ram usage, high v-ram usage, high cpu usage, windows specific libraries being used, and too many shaders for the 360 to handle. –  AttackingHobo Mar 3 '11 at 20:07
1  
-1. It sounds like you don't really know what you are talking about either. HiDef profile compiles to xbox360, HD does not use dx10, and yes, I didn't mention the libs or ram usage as that was not in the question. This might be worth reading: blogs.msdn.com/b/shawnhar/archive/2010/03/12/… . Also, I did mention a few times that I was not 100%s sure. –  dotminic Mar 3 '11 at 21:38
add comment

You cannot use directx10 in xna.

If you wish to have DX10 and DX11 features in C#, i suggest using SlimDX, which is great framework over directx. It contains "sample framework", similar to XNA. If you don't mind losing the xbox and win 7 phone support, slimdx is giving you more freedom and better performance than XNA.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.