Direct3D 編程新手:11 與 12 (New to Direct3D programming: 11 vs 12)


問題描述

Direct3D 編程新手:11 與 12 (New to Direct3D programming: 11 vs 12)

對於 D3D 編程的新手,應該直接學習 D3D12 還是在深入研究 D3D12 之前必須先學習 D3D11?

假設從零開始並具備良好的 C++ 知識,這我應該怎麼走?


參考解法

方法 1:

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.

(by CodeAngryChuck Walbourn)

參考文件

  1. New to Direct3D programming: 11 vs 12 (CC BY‑SA 2.5/3.0/4.0)

#direct3d11 #direct3d #direct3d12






相關問題

Адлюстраванне дынамічнага буфера ў Direct3D11 у праграме Windows Store (Mapping a dynamic buffer in Direct3D11 in a Windows Store App)

未處理的異常@ClearRenderTargetView() (Unhandled exception @ ClearRenderTargetView())

將 3d 模型導入 Direct3D 11 示例 (Importing 3d model to Direct3D 11 Example)

編譯器不允許我使用“DDSTextureLoader.h”和“WICTextureLoader.h” (Compiler won't let me use "DDSTextureLoader.h" and "WICTextureLoader.h")

在我從舊版 DirectX SDK 更改為 Windows SDK (Visual Studio 2015) 後,鏈接器一直在抱怨 (The linker keeps complaining after I changed from legacy DirectX SDK to Windows SDK (Visual Studio 2015)))

鏈接器給出了我在我的應用程序中根本沒有使用過的函數的錯誤 (Linker gives errors about a function that i have not used in my application at all)

Direct3D 11 中輸出圖像的雙線性過濾 (Bilinear filtering of output image in Direct3D 11)

Direct3D 編程新手:11 與 12 (New to Direct3D programming: 11 vs 12)

如何在 Direct3D 11 上使用字體文件渲染文本? (How can I render text using font files on Direct3D 11?)

獲取 D3D 調試信息? (Get D3D debug information?)

為什麼 XMMatrixLookAtLH 會導致調試錯誤? (Why does XMMatrixLookAtLH result in a debug error?)

InterlockedAdd HLSL 潛在優化 (InterlockedAdd HLSL potential optimization)







留言討論