Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New to Direct3D programming: 11 vs 12

For a newbie in D3D programming, should one just learn D3D12 directly or is D3D11 necessary before diving into D3D12?

Assuming starting from scratch and decent knowledge of C++, which way should I go?

like image 875
CodeAngry Avatar asked Nov 29 '15 19:11

CodeAngry


People also ask

Is Direct3D 12 better than Direct3D 11?

Direct3D 12 represents a significant departure from the Direct3D 11 programming model. Direct3D 12 lets apps get closer to hardware than ever before. By being closer to hardware, Direct3D 12 is faster and more efficient.

Is Direct3D 12 the same as DirectX 12?

DirectX 12 introduces the next version of Direct3D—the 3D graphics API at the heart of DirectX. Direct3D 12 is faster and more efficient than any previous version. Direct3D 12 enables richer scenes, more objects, more complex effects, and full utilization of modern GPU hardware.

Is DirectX 11 the same as Direct3D 11?

Well, this is as quick as can be without being too brief. First, a bit of clarification: Direct3D is a subset of DirectX. DirectX contains Direct3D which is the primary graphics handling portion of DirectX. OpenGL, on the other hand, is it's own API.

Is there a visual difference between DX11 and DX12?

Re: visual difference between Dx11 and Dx12? There is no visual difference. Difference is in performance. Sometimes using DX 12 helps to improve the performance by 10-20 FPS.


1 Answers

I've answered this question before so you should take a look at that post.

In short, Direct3D 12 should be thought of as "DirectX Extreme Pro". It assumes you are already an expert in how the Direct3D 11 runtime works to the point that you can basically write it yourself. It is designed to allow middleware engines and low-level graphics developers to have maximum control over the behavior of the GPU. Direct3D 11 is also a "low-level" graphics API, but DirectX 12 has such a thin abstraction that many complexities of modern GPUs are exposed directly to the application programmer; complexities that Direct3D 11 hides from you.

Direct3D 12 is very powerful, but to achieve a very low CPU overhead, the API and runtime do very little to help you out. This exposes the memory model of the driver and makes the GPU/CPU synchronization a manual process that's a bit akin to 'lock-free programming' on the CPU.

If you are entirely new to Direct3D, I strongly suggest you start with DirectX Tool Kit and its tutorials using Direct3D 11. Once you've mastered that, you should be in a good place to move to Direct3D 12 when it makes sense for your applications.

There's a ton of tutorials, samples, books, and other educational material on Direct3D 11. The Direct3D 12 material is a bit thin, mainly consisting of the content on the DirectX-Graphics-Samples GitHub repo. I'm currently working on adding DirectX 12 support to DirectX Tool Kit, but even when it is available you'll find that starting with Direct3D 11 is a lot easier than trying to jump feet-first into DirectX 12.

The other thing to keep in mind w.r.t. to DirectX 12: It is supported only on Windows 10 systems with DirectX 12 enabled video drivers. This includes most Direct3D Feature Level 11.0+ hardware including NVIDIA Fermi, Kepler, Maxwell; AMD GCN; and Intel's Haswell, Broadwell, and Skylake. This, however, does not include any older video cards. See DirectX 12: A Major Stride for Gaming, AMD DirectX 12 Technology, and DirectX Developer Blog

UPDATE: DirectX Tool Kit for DirectX 12 is now available including basic tutorials. You should focus on learning Direct3D 11 before tackling Direct3D 12. DirectX 12 is an API designed for graphics experts and is quite unforgiving to newbies. DirectX Tool Kit helps soften the edges a little, but not much. Generally speaking, unless you are hitting the CPU performance limits of Direct3D 11 there's no need to use Direct3D 12. That said, for graphics experts it's worth learning to have a better understanding of how the underlying GPU hardware works, or those wanting to push the hardware to the limits of performance.

UPDATE 2: I should mention that based on some recent experience, if you mainly use the functionality provided in the DirectX Tool Kit (sprites, spritefont, basic primitives and models, etc.), switching from the DirectX 11 to DirectX 12 version is fairly straight-forward. Also, if you want to use DirectX Raytracing, DirectML, or Shader Model 6, you need to use DirectX 12 instead of DirectX 11. Of course, most game developers actually use existing 3rd party engines like Unity or Unreal Engine which abstract the API so it's more an issue of your target platform instead of usability for those cases.

like image 155
Chuck Walbourn Avatar answered Oct 12 '22 08:10

Chuck Walbourn