15
\$\begingroup\$

I'm just starting to get into 3D programming with Direct3D. What version of D3D should I pick up?

11 looks pretty neat, but 9 and 10 still seems to be pretty present. Given the current state of the game development industry, which version does it make more sense to start using?

\$\endgroup\$
1
  • \$\begingroup\$ "Which technology to use" questions are not good Q/A questions. \$\endgroup\$
    – House
    Jun 24, 2013 at 17:11

5 Answers 5

12
\$\begingroup\$

That depends on whether or not you want to design an engine to produce a game to be done in three years, or one year or six months, and whether or not you're thinking of console ports. It'll be relatively easy to throw out a 360 port of your game from Direct3D9, but you'll need to do a lot more originating from D3D11. Remember that D3D11 locks out all XP users, if not necessarily all D3D9 hardware.

The most recent Steam survey suggests that about 16% of people still use Windows XP. Can you afford to cut them out? By the time your game is done, how will this have changed? Are you going to use features that depend on the higher level API? These are questions that you will need to answer yourself.

Direct3D 9 is pretty damn accessible and you can reach a lot of people with a D3D9 game, but it's days are numbered, especially on the PC. If you're not interested in targetting those people, then there's little point to it.

Oh, and don't bother with DX10. There's no reason at all to use it over DX11. Unless you want to use D2D/DirectWrite, which is not unreasonable.

Of course, it's worth mentioning that in DX11, there are no replacements for classes that, as a hobbyist myself, I found extremely useful in DX9. Such as ID3DXMesh, ID3DXSprite, ID3DXFont, have to compile ID3DXEffect from source, etc. Microsoft recommends DirectWrite to replace ID3DXFont, but of course, they forgot to actually make DX11 compatible with the new Direct2D/DirectWrite systems, which in my opinion was blindingly stupid.

\$\endgroup\$
7
  • \$\begingroup\$ Why did they remove the effect framework ? It was a very useful class IMO. \$\endgroup\$
    – dotminic
    Feb 4, 2011 at 1:39
  • \$\begingroup\$ @__dominic: It's not removed, but you have to compile it yourself. \$\endgroup\$
    – DeadMG
    Feb 4, 2011 at 1:53
  • 1
    \$\begingroup\$ @__dominic: As DeadMG pointed out, the effect framework was not removed, it was factored out into a standalone set of code files you can compile yourself -- this was allegedly done to allow it to be versioned more fluidly than the D3D core, and ease deployment issues (particularly around D3DX). \$\endgroup\$
    – user1430
    Feb 4, 2011 at 1:55
  • 1
    \$\begingroup\$ I think worse than cutting out 25% of XP users is that only 17% have DX11 GPU's (as of now). \$\endgroup\$
    – DMan
    Feb 5, 2011 at 1:03
  • 2
    \$\begingroup\$ @DMan: D3D11 can run on downlevel hardware, including D3D9 hardware. \$\endgroup\$
    – DeadMG
    Feb 5, 2011 at 12:30
9
\$\begingroup\$

tldr: Learn D3D11.

The difference between 10 and 11 is pretty small, in terms of the shape of the API. D3D11 allows you to use down-leveling to write code against the D3D11 API that will run all the way back to D3D9 class hardware (note that you will still require Vista or better however). So you may as well learn the newer API, which I feel is cleaner and more uniform anyhow.

However, if you don't have Vista or better, or you eventually want your own code to run on XP (to for example distribute your game to XP users), you're going to have to use D3D9. The XP market is probably shrinking, though, so I'd say go for 11 if you can.

\$\endgroup\$
3
\$\begingroup\$

If you're completely new to 3D programming, and especially if you're new to COM and Windows programming, I would strongly advice against learning DirectX now. In my experience, DirectX is an extremely powerful tool, but it has a very steep learning curve, which you must consider in addition to the learning curves of Windows programming, 3D programming and many others. If you start with DirectX, you might feel overwhelmed by all the details of making boilerplate code, so I advice against it.

Instead, I would recommend a simpler API that allows you to focus more on learning about 3D programming. XNA is quite nice, and since it lies on top of DirectX, once you move to DirectX, you'll have some ideas that will make the DirectX learning curve much easier to take on.

Now, if you have experience in 3D programming, such as with OpenGL, and you know how to do COM programming, I'd recommend DirectX 11. Anything but the latest version is obsolete, and any experience you get from it will be useful for a shorter span of time.

But then again, true experience comes from variety, so I'd recommend you learn both DirectX and OpenGL, and also XNA if you want, and as many APIs as you can. That way, you will have an abstract knowledge of how 3D programming works with different tools, and you will be able to use the right tool for each job.

\$\endgroup\$
2
\$\begingroup\$

I recommend DX11 or DX10. The difference is very small. You can just do more things with DX11 (hw tessalation, better gpgpu, output to multiple textures on pixel shader..). DirectX 9 has another architecture and is little outdated at the moment. If you are asking about current game dev industry: for curently developed pc games is DX9 dead.

But i have to say:
Don't care about api, once you really understand how graphics works, learning new api would take max one month. Even shorter time.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ DX9 isn't outdated. There are still a ton of potential users on XP. It may not be in development any more, and is going to become outdated in the next few years, but for now it isn't. \$\endgroup\$ Feb 4, 2011 at 16:04
  • 1
    \$\begingroup\$ @thecommunistduck I agree,but DX9 is totally outdated for learning it. Because once beginer who start learning it now,will know it well...it will be outdated. And sure i told it bad in my answer. \$\endgroup\$
    – Notabene
    Feb 4, 2011 at 16:57
-5
\$\begingroup\$

I heard that dx9 with win xp system is single core based system. It is old tech. I recommand you dx11.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ This answer doesn't add anything productive, and it's unclear (and potentially wrong and misleading) what you're suggesting regarding a "single core system." \$\endgroup\$
    – user1430
    Jan 25, 2013 at 7:03
  • 1
    \$\begingroup\$ Plus "I heard that..." is not a credible source of evidence (or pretty much anything, really). \$\endgroup\$ Jan 25, 2013 at 10:19

Not the answer you're looking for? Browse other questions tagged .