Confused About XNA and DX10
I am confused about the differences between XNA and DX10;
is that correct:
1- XNA will have both fixed function and shader programming and effects also?
2- DX10 will have only shader programming with no assembly, no fixed function and no effects.
3- DX10 will be on Vista only, since it is shader programming will Shader 3.0 (DX9.0 C and L) is compatible with Vista shader 4.0, so a program written on Windows XP DX9.0 C will run on Vista DX9.0 L but will not run on Vista DX10 shader 4.0?
But why it will not run on DX10 Vista runtime? if the program is only shader with no effects? is that because shader 4.0 will not be compatible with shader 3.0? or it will run?
regarding windows controls with DX:
1- can we build application now on DX9.0 C, shader 3.0 only with no effects with UI controls using windows Forms? will it runs under Vista with DX9.0 L?
2- we can't build application on DX10 shader 4 with UI interface with WPF? since WPF and DX10 are not to be used together? is that correct?
3- what will be the method to build application with user interface controls with DX10 and separetly DX9.0 L under Vista?
thank you for the answers..
[1219 byte] By [
mabrouk] at [2008-2-7]
i think that XNA is for C#, DX10 is for C++. XNA works with GSE/xbox360, dx10 does not. i'm not sure about the rest of your questions.
- XNA supports like stated in the FAQ only the programmable shader pipeline.
- Direct3D 10 supports only HLSL shaders. Even if it use internal some kind of assembler system you can’t access it anymore. They effect system is still there and updated to the requirements of the new API.
- Yes Direct3D 10 will be only available for Windows Vista. But Vista contains support for older Direct3D versions too. A program that was written for Direct3D 9 will use Direct3D 9 on Vista.
- Every application you build today with Direct3D 9 on Windows XP will be run on Windows Vista.
- You can use Direct3D 10 and WPF together like you can use Direct3D 9 and WPF together.
- I am not sure what you are asking here. The user interface controls are still separated from the window that is used for Direct3D 9/10 output.
Maybe you could describe what you are trying to do or what you are aiming for.
Ralf Kornmann wrote: |
| You can use Direct3D 10 and WPF together like you can use Direct3D 9 and WPF together. |
|
Be aware that there are are issues with this. See the slides starting from here.
Jim Perry wrote: |
| Be aware that there are are issues with this. See the slides starting from here. |
|
I know this as I am already tried to use WPF for in game UI. But this doesn’t change based on the Direct3D version you use.
thank you all for the expalanations. it make things more clear. thanks.
1- the answers indicates we can use WPF with a DX9.0 C or L program... I was under the impression that directx in general does not allow window forms or controls or WPF controls with the application?
2- is there a reference to a sample program with WPF and DX9.0 C that compile on vs2005 under window xp? either a shader program or FFP program?
3- I read there is DX10 (?) in the August2006 dx download. I could not see such files, where are they located with the SDK directory on C: drive?
4- is there is a sample of DX10 on Aug2006 SDK to show WPF and DX10 shader program?
5- You inidcated that the effects framework is presence on DX10, is that means DX10 shader programs can use effects framework which is not shipped with DX10 (as some comment stated)?
or we should use DX10 without effects frameworks?
6- I found limited reference to effects framework, it seems mysterious, is there a tuotrial on effects frameworks that is readable?
7- to clear what I was trying to do/ask:
I am trying to find the best way now to work on a simple CAD/CAM application using only the current updated tecniques.
a- use WPF itself as a CAD platform is feasible because it contains the XAML as format holder and is readable, and has some of the basic feature primitives to structure a simple cad canvas.Under Vista
b- use DX10 if it can be used with WPF (wpf as form maker/controls for the canvas) and use DX10 on the convas? udeer Vista
c- use DX9.0 C/L on the canvas if it can be done with (live with) WPF rich from/controls on the same screen? under Vista
d- the last option use DX9.0 C/L as canvas if it can exist with window forms on the same screen under Vista
e- all the above option can be exercized under windows XP if the auguts2006 has DX10 access?
thank again for the the comments.
another question about the managed aspects of DX:
1- as i read DX9.0 L would be MDX2.0, and it will be the XNA in this case?
2- XNA will be a separate products from DX9.0 L under Vista?
3- XNA will be a separate products and it will run under XP as under Vista using C# in VS2005?
4- the comments that DX10 is only for C++, which means no managed C# program? then how to use MPF which usually will run under C# or VB to create DX10 shader program on the convas of C#/XAML program?
thank again
1. You can use WPF/Windows Form and Direct3D in one application as long as every API is responsible for its own part of the window. You can use a Direct3D view and add window forms controls around. But it is not possible to use such controls above your Direct3D area.
2. I am not aware of such a sample. But the WPF documentation contains something about interop.
3. The Direct3D 10 parts are in the different sub folders like the Direct3D 9 parts, too.
4. I am sure that no such sample exist but in general it’s the same solution that is needed for Direct3D 9 interop.
5. The Direct3D 10 effect framework is part of the core API and nearly every sample in the SDK makes heavy use of it.
6. As written the Direct3D 10 tutorials already use the effect framework. Therefore there is no addition tutorial.
7.A The 3D functions of WPF works with Windows XP too.
7.B As long as your 3D view and the controls does not overlap this should possible.
7.C As long as Direct3D 9 and WPF areas don’t need to overlapped this will work with XP and Vista.
7.D Window forms and Direct3D views can be mixed too as long as they don’t overlapped.
A-D: In any case this will only work with windowed applications. In fullscreenmode you can’t use different APIs.
7.E: For the Direct3D that is delivered with the August SDK you will need Vista RC1.
1: The Vista extensions for Direct3D 9 (aka D3D9.L) have nothing to do with MDX 2. MDX 2 was a new version of MDX 1.1 based on .Net 2.0. But it will now replaced with the XNA Framework.
2: The XNA framework is a managed assembly that will based on Direct3D 9 on the PC platform. This is true for Windows XP and Vista.
3: Yes. But the framework can be used with other managed languages too. Only the XNA Game Studio is currently bound on VS C# Express.
4: Direct3D 10 is still in beta and there is no official managed assembly yet. I have written such a assembly that allows using Direct3D 10 with C# or any other managed language. But I am sure as soon the unmanaged version of Direct3D 10 is final Microsoft will start to develop an own managed layer for it.
thank you very much, this was very helpfull comments, thank you again.
1- DX10 is not managed, but a shader program is very disticnt in iteself as a unit ( as I understand), however, the driver program for the shader block has to be in DX10 calls for device creation which is not in managed API calls. hence must use C++ for WPF/DX10 under Vista RC?
2- since, DX10 only exist within the SDK but only run under Vista RC, is that why I cant see any reference to DX10 in my SDK files on Win XP C: directory?
3- what is the reference to your managed wrapper? I assume I can only us that under Vista RC only not XP?
4- shader 4.0 in DX10 still use the effects framework? also, XNA is use the effects framework?
what reference to the effects framework? why the effects are separated from shader/DX10/9 however, their use is required or not since there are shader samples without effects?
5- we can safely assume that DirectX programming should be limited to shader without effects under DX10
6- Can we assume for DX9 L=XNA to do shader programming only since it is the only available method to work toward DX10 conversion of the code from XP to Vista.
7- can we assume the XNA is a portable graphic library to use in games or other graphics which is not tied to the OS?
8- then if we use shader programming 3.0 under MDX 2.0 type of program with vs2005 using XNA express engine and Win Forms, we can recompile this program "latter" under Vista (non-beta) under XNA express under vista in the future? (since I do not know what XNA express looks like)
9- under Vista RC only you can use WPF/DX10 with C++ to make a programs or use Managed wrapper and use C# for WPF/DX10 shader (no XP)?
10- under Vista RC we can use WPF/DX9.0C/L as managed code and shader programming to create program (no XP)
11- under XP we can use and make programs with WPF/DX9.C under current CTP version of winFX? and this program will recompile and run under Vista?
thanks again I think the cycle is clear now: use the managed wrapper for DX10 under Vista for Vista only..
It looks like you have mixed something up here.
Currently and in future Microsoft offers a bunch of different APIs to access the graphics hardware:
Unmanaged Direct3D 9: It the root 3D API that can talk with the driver which talk with the hardware
Managed DirectX 1: A layer above the unmanaged Version of DirectX 9 and therefore Direct3D 9. It was original build to work with the .Net Framework 1.1 but works with the newer 2.0 version too.
Managed DirectX 2: Another layer above unmanaged DirectX 9. This time it was build against the .Net 2.0 framework. It’s was never released for production and is canceled now.
XNA Framework: It’s a managed layer too. Based on the experience with the two former managed DirectX version it contains the latest development in the range of graphics API. Beside of the PC version which make use of Direct3D 9 and .Net 2.0 there will be an Xbox 360 Version that use the native Xbox 360 API and the Compact Framework 2.0.
WPF: The Windows Presentation Framework is build on Direct3D 9 and use managed and unmanaged DLLs to do it’s work.
D3D9EX (aka D3D9L): An extended Version of Direct3D 9 that works only on Windows Vista.
Direct3D 10: The next generation of the Direct3D API. Works only on Windows Vista too.
Every one of these APIs offers you a different level of abstraction. Beside of WPF all APIs support an effect framework but it’s not the same framework for all. The feature set of the framework depends on the feature set of the API. APIs that don’t support fixed functions anymore won’t do this in their effect framework too. In any case effect frameworks are build above the base functionality of an API and you are not forced to use them. But the can simplify many tasks.
As these are only APIs and Microsoft haven’t change the file format for executables since the first 32 Bit Windows version you don’t need to recompile if you move from one Windows version to another. As long as the operating system supports the used APIs it will work. On the other Hand if you move from one API to another one a simple recompile won’t help you as you have to change the source code. Beside of D3D9EX and Direct3D 10 all former APIs works on Windows XP and Windows Vista.
As you already noticed there are now official managed layers for Direct3D 10 or D3D9EX but like every layer over Direct3D 9 they will only work on operating systems that supports the unmanaged API. This will limit a managed layer for Direct3D 10 to Windows Vista. This is fundamental true for my own managed Direct3D 10 layer, too. But as I am working on another project that provides the interfaces and methods of Direct3D 10 for Direct3D 9 it works on Windows XP too. But it doesn’t offers full Direct3D 10 functionality there. It is only a way to increase portability.
In your case I would not jump to fast on the Direct3D 10 train as Windows Vista is not the only restriction of this new API. Additional to the new operating system you will need new Direct3D 10 compatible hardware too.
thank you very much Ralf. it is very professional from you to take the time and efforts to provide explanations:
there are few issues still need comments:
1-Ralf: "there are now official managed layers for Direct3D 10 or D3D9EX "
In the AugSDK, the DXD10 folder contains only C++ files? where is the that managed (C# wrapper)
2- despite the fact that C++ is the language of choice, compared to C# syntax, it is not pleasent to read.
does DXD10 will have C# managed wrapper? that will allow exchange between XNA and DXD10?
3- XNA will be the C# managed DXD 9.0 used in Express IDE for winXP.
does that means we do not consider current DXD9.0C (not literally) is course to take for new projects, but we should use XNA?
4- DXD9EX(L) will be just there to allow programs to run from winXP on Vista.
but DXD9EX will not be available on winXP computers?
5- now the option is to work with
DXD10 C++ for Vista, for .net 3.0 , shaders programming only
or work with DXD9.0C = MDX(2?) for .net 2.0 for XP or (DXDEX(L) Vista runtime) , shaders or FFP
or go to XNA Express IDE and use for C# development (assume it is MDX 2.0 for .net 2.0) I assume Shaders only like DXD10?
the XNA question is does XNA desktop program for win XP, will run on Vista? yes and it will use an XNA framework.
does the XNA framework of XP wil be the Same for Vista or different?
6- if XNA for Vista will be a available,
then we can use it for managed C# programs instead of the managed wrappers for DXD10 ?
7- I did look at the documentation for HLSL and read on the subject. I read your request comment on the DXD9/10 interface layer for Vista.
shaders program should be somehow consistent regardless of the version with minor variations? only the effects vary due to its dynamics changes?
so if we write a shader program in XNA C#, it should be easy to port to DXD10 managed version?
it seems there is a desire to look away from C++ in writing games? XNA, which will transfer to Vista?
8- the use of controls or froms with DXD.
I found attempts to make "custom controls" on the single window-form with canvas on the top and the controls on buttom.
i understand that controls and convas do not mix as I seen in samples. but i did not see a form/window tools bar as needed for a desk top application? however, games really does not need such capability. this is the major reason why DXD is difficult to apply for visualization and other desk top graphics application. if microsoft is dropping OpenGL, then why they do not create easy window canvas for graphics on forms for DXD rendering?
a- Windows Forms does not have Canvas for drawing by DXD, only by GDI++? hence the use of custom control?
my question on controls and forms is several point:
b- WFP is the Form/GDI/DXD of the Vista model. the canvas thus is for WPF is not really a DXD canvas since we really do not have a DXD shader or equivalent, but we have a new rich GDI++ .net 3.0 with more power (?) than the .net 2.0 gdi++?
c- WPF will create a form and controls, but also, we can create DXD canvas on other form (MDI concept), but it seems now such structure was available in .net 2.0 but no such MDI can be done?
d- Will XNA capable of handling MDI forms one of which is the Canvas for DXD?
thanks a lot for your answers, they are very enlightining in this confusion.
- There is no managed layer for D3D10 in the August SDK. I am working on one in my spare time that I will provide on mdx info.
- I have read that Microsoft will provide a managed version of Direct3D 10 later. But they haven’t announced an roadmap for this. Anyway it’s always possible to write your own managed layer for every unmanaged API. I haven’t see enough from the XNA Framework to say how hard it would be to integrate D3D10. But as one of the main aims from the XNA project is the unification of PC and XBox 360 development I would not count that it will happen soon if every.
- You should use the API that helps you to solve your problem. XNA is primary written for games. Because of it’s unification I hardly believe that it play well with other PC only technologies like WPF/Winforms.
- D3D9EX provides some of the advantages of the new driver models to D3D9 developers. As Windows XP does not support the new driver model it will not support D3D9EX.
- There should be no difference between running the XNA framework on Windows XP or Windows Vista.
- I am not sure if I understand you right. There are currently no dependencies between XNA and Direct3D 10. If you use the XNA framework you will need the framework on your target system. If you use D3D10 you will need Windows Vista and D3D10 compatible hardware.
- All DirectX APIs (including XNA framework) use HLSL. The only thing that differ are the supported shader models. But it is often possible to compile the same shader for different models with any change. I would not say that C++ is dead for game developing. In the case of XNA using a managed language was the logical way to support different CPUs and all the security that is needed for a console.
- OpenGL is not dropped in any way. The support is even improved on Windows Vista. But even there OpenGL and Direct3D still face the same problems when it comes to airspace.
- You can easily add a windows form control like a picture box to a form and create a D3D device or a swap chain for it. There are examples in the web that shows how to do this.
- WPF is not bind to Windows Vista. It will works well with Windows XP as .Net 3.0 in general. I am not sure what you mean with more power but you can do more things with WPF more easily that with GDI/GDI+.
- I haven’t done MDI work with WPF yet. Therefore I am not sure how it works.
- As XNA is primary designed for games that should work on the PC and the XBox 360 I would not count on this. MDI is not really a game concept.
Thank Ralf for your comments again.
it is all clear now (I think). XNA express arrived today and I did look at.
it seems that xna is more cleaned version of MDX, with a pre-determined format for a game, which is good for that.
I tried to make or insert a window form into the xna format and it is not accepting most of the syntax to declare and show a form?
I do not know if this is that xna will not do that or because I do not know how to put the form there to appear as a second window?
A- WPF is the method of choice to build a form with its WPF-graphic- API with C#/XAML (it is not DX3D, but it is diluted DX in form of GDI). I do not see how we can call WPF a directX API variant?
however, the power of DX3D in general should not be ignored for any application in graphic.
B- Not To Be Confused:
1- DX10 under vista is needed to be migrated to under a managed layer
so in the mean time we can Ralf MCDX layer and work with that, because it the current/near future version of DX driver under vista but do not consider XNA managed program to be ported to DX10 because the use of WPF/DX10 is totally different, + in addition to
2- WinXP platform need to be addressed because it will be several years to before Vista became the viable choice to use and mature DX10 to managed platform
3- then use of XP MDX2 is not correct, because XNA is the replacement for that. so for XP, XNA managed DX is the method to use for XP now (because it is more cleaner)
4- DX3DEX is not a viable solution now to new application, it is there to allow XP DX9/MDX application to run under Vista.
DX3D9EX is for application alreadey existed and allow it to be ported to Vista.
5- to continue to work with managed C# DX the older (now) DX9.0 C is now supplanted by XNA and no need to use dx9t for new application.
C- all this make the case for XNA and for WPF / DX10?
since XNA will bridge XP to Vista as XNA version advance.
XPA is the replacement for MDX DX9.0 C(XP) and DX3DEX (vista even if this statement not fully correct).
D- I understand why XNA is published now, but what is microsoft attention? it seems that DX10 has to go away in the future under the hoods of the operating system and has no use as development API becaus XNA will migrate to vista and the new driver model (regarding handles), and WPF will grew more closer to port more DirectX graphic functions not model (no game loop here)?
E- let us not forget that we can use WPF under XP now using CTP. is that means we can build application using the CTP and used under XP in the futur? allow the same WPF that arrive under Full Vista to be applied to XP - is that can be realistic assumption? if that is true then we can make application under WPF, but they will make not to run outside debug environment?
now 2 question on controls in forms/dx3d:
1- can we (try) to make a form inside a XNA program to be shown as a separate form for UI? or the compiler does not allow that?
the window creation step is hidden in the initialization syntx of the window creation? How can we know more about that structure operation?
2- unless XNA morph to WPF (and why would they do that), it will alwayes stay in their window/full screen form with no controls even if it moved to Vista?
thank you for you comments all that time