DirectX/C++ 3D Engine programming: Learn now, or wait for DirectX 12? [closed]
Asked Answered
C

2

5

I'm a relatively ok-ish programmer, but my main focus has been in application development with C# so far. I have almost zero experience with game development and 3d engines - I've begun reading up on how 3d Engines work in general, e.g. there was a wonderful guide explaining how to develop a very simple software-based 3D engine in C#. Very helpful, but that pretty much summarizes my whole experience with the topic. Also, I haven't really been working with C++ much so far (even though I'm aware of the basic conceptual differences to C#, and would consider getting up to at least "sufficient" speed in that language manageable).

So anyway, out of pure personal interest, I'd like to play around with developing - or rather, learning how to develop - simple DirectX-based 3d Graphics Engines for educational purposes. I'm simply interested in the graphics parts (no sound/animation/game states/networking or whatever, only very rudimentary input). Rendering some simple geometry, and then progressively learning how to extend this with more modern shading techniques would be fine.

I've already found some great resources for this. But before I dig into the topic: I know DirectX12 is around the corner, and seeing how much it seems to evolve the system, I'm really not sure if there are going to be many breaking changes to the API. Or in other words: I'm afraid that I start learning DirectX 11 stuff now, and in a few months from now it'll all be useless as DirectX 12 works in a significantly different way, from a programming point of view.

I'm not sure how much of this is already known, or if there are developer previous available to the broader public already. But if its possible to tell already: Would you guys recommend me waiting for DX12, or start with v11 as development will be very similar in the future anyway?

For the record, I know of course that learning DX11 won't hurt in any case. But I'm not in a rush, and if half of what I'd be learning now becomes obsolete in a few months, I'd prefer just waiting until then to slowly get started.

Ceremony answered 18/4, 2015 at 16:24 Comment(0)
O
13

Think of DX12 as "DirectX without training wheels, without brakes, and at the moment maybe without tires".

It will be more than a 'few months' for DirectX 12 to have a rich set of tutorials, support libraries, best practices, rock-solid drivers, and widely deployed support in the operating system on end-users machines. It's "bleed edge" right now, and best consumed by GPU graphics programming experts actively working on titles and engines today who want to make sure it all works.

For everyone else, learn DirectX 11 at least for the next year or so, and possibly longer depending on the needs of your app, your personal skill level, and the focus of what you are trying to learn in the meantime.

What I can say is that learning to program DirectX 11 using the legacy DirectX SDK stuff like D3DX is a dead-end for DX12. Focus instead on DirectX 11 using 'modern' helpers like DirectX Tool Kit and DirectXMath for C++.

UPDATE: DirectX Tool Kit for DirectX 12 is now available along with some tutorials. That said, it is best to learn Direct3D 11 first as Direct3D 12 is an API designed for graphics experts and is quite unforgiving for newbies. Knowing how to use DirectX Tool Kit for DX11 will naturally map to the DirectX 12 version if you want to go that route.

Ozuna answered 21/4, 2015 at 17:51 Comment(3)
How does your answer stand in almost 2019? Just curious if you would recommend otherwise at this point, thanks!Propend
DirectX 12 is still very much a "expert API", and you really need the experience of working with DirectX 11 to help you up the very steep learning curve. It's also quite challenging to debug at times, although the modern PIX tool helps a lot. There are more resources out there on the web than when it was first introduced, and as I noted in an update DirectX Tool Kit for DX12 is also an option now. I'd still recommend you start by knowing DirectX 11 first.Ozuna
If you want some 'side-by-side' examples to see how DX11 vs. DX12 differ, see GitHub.Ozuna
C
2

Most of what you will learn using DirectX 11 will be applicable if you switch to version 12.

In fact, for your purposes, you may not ever need to switch. DirectX 12 essentially trades off ease of use for CPU performance. It also requires Windows 10, so it's going to be more than a few months before it becomes widely used.

DirectX 9 is still widely used for making games, despite its age. I wouldn't recommend it if you're starting from scratch though.

Oh, and whatever you do, don't choose DirectX 10. DirectX 11 can do all the same things, on the same graphics cards and operating systems.

Chrestomathy answered 18/4, 2015 at 18:42 Comment(4)
DirectX 9 is still supported for three reasons: (a) the codepaths are already written for many engines and existing tools, (b) Xbox 360 was Direct3D 9 although it had so many extensions that's probably not exactly correct but it kept 'DirectX 9 era design' alive for a really long time, and (c) for people specifically targeting China or Russian, you really have target Windows XP. That said, the debugging and tool support or Direct3D 9 on modern Windows platforms is lacking for DirectX 9 and is more and more emulated rather than being in any sense "Direct"Ozuna
DX11 is the current 'sweet spot' for learning DirectX, and applies to all supported Microsoft platforms: Windows Vista SP2+KB971644 or later supports DX11 for Windows desktop apps, and it is the minimum required for Windows 8.x Store, Xbox One, Windows phone 8, and universal Windows apps for Windows 10. Plus the tool support is good, and you can find lots of replacements for legacy D3DX stuff that supports DX11. Support libraries and even understanding of proper usage patterns for DX12 are still in development.Ozuna
There was another reason to use DirectX 9 - if you needed to support old D3D9 graphics cards you can use Shader model 3 (and 2a/2b) on them with DX9. DX 10 and 11 support them, but only with shader model 2.Chrestomathy
true, but that's really an edge case these days which is why 10level9 doesn't expose true Shader Model 3.0--plus it adds a lot of technical complications. It is not in general worth maintaining an entire Direct3D 9 codepath just for this technical detail on some cards. If you happen to have a Direct3D 9 codepath for some other reason, then maybe you might push the few customers you have in this particular configuration to use it, but most are served better by using Direct3D 11 codepaths unless they are running Windows XP.Ozuna

© 2022 - 2024 — McMap. All rights reserved.