Getting started with DirectX 11
(mainly gathering resources for learning)
It can be tough to find up to date DirectX 11 tutorials, guides or series for beginners out there. Here I gather links, YouTube playlist or articles to start your journey with DirectX API and graphics programing.
First you should know that DirectX 11 is the equivalent of OpenGL 4, and DirectX 12 of Vulkan. It is recommended to learn DirectX 11 / OpenGL 4 first. If you need more control and performance then DirectX 12 / Vulkan will provide a low level API designed for experts that already master DX11/GL4. Items that I recommend the most to start learning are emphasis in orange.
Porting
In the past DirectX development would require the DirectX SDK you would typically use the header "d3dx11.h" and functions like D3DX11xxxxx() or D3DX10xxxx(). The SDK is now deprecated and the DirectX API now available through the Windows Development Kit that comes when installing Visual Studio. In this version you will rely on "d3d11.h" and D3D11xxx() functions. Unfortunately during this change many features have been removed (such as texture creation, or shader program handling). Therefore you need to rely on other libraries to find functions equivalent to the old SDK. (source) Mainly, you need the DirectX Tool Kit. But this is also true for the obsolete "xnamath.h" math library now replaced by "directxmath.h" (migration from the xna math library). Here is a list of other equivalences and other necessary libraries: walbourn.github.io/living-without-d3dx/
A lot of old DirectX11 code and tutorial out there will need some porting as they rely on the deprecated DirectX SDK. Here is an example of such porting from the old SDK to the modern Windows SDK and DirectX Tool Kit etc:
www.asawicki.info/news_1604_adventures_with_porting_code_to_visual_studio_2015_and_no_directx_sdk
You can install the tool kit with NuGet or compile it from source (Compilation is relatively easy):
github.com/microsoft/DirectXTK/wiki/Adding-the-DirectX-Tool-Kit
Tutorial to the DirectX ToolKit (although I would recommend starting from a tutorial series using the toolkit first before reading this): github.com/Microsoft/DirectXTK/wiki/Getting-Started
Web Resources
Window setup:
- [ My C++ sample ] to setup a basic window with Windows API; every line of code is explained with comments and links.
- MSDN Win API window setup (without DirectX)
- Official DirectX 11/12 Win32 code samples (you can also install this VIX to make the samples available to Visual Studio on 'Create New Project' :)
- DXUT: a glut like window manager well suited for sample code or demos (unmaintained)
- ImGui: Win32API window setup or SDL window setup
- (quite bad) Basic Directx 11 tutorial, VS2019, Win32 window API: tutorial / code
- (No window setup, no code sample) DX11 initialization, draw triangle tutorial
- Short intro to DX11 with SDL Window
- [ DirectX Error Library ] to make returned 'HRESULT' values human readable.
Complete series:
(Youtube playlists)
- ChiliTomatoNoodle VS2017 and Github code samples.
- Jpres Provides recent DirectX 11Tool Kit samples for each video in github.
- Avoyd advanced tutorial to use DirectX11 & ImGUI with RCC++ (Runtime Compiled C++) / VS2019
- Matt Guerrette VS2012
- Old Udemi course based on the obsolete SDK
(Articles)
- RasterTek tutorials (port of RasterTek to VS2017) (uses the obsolete DirectX SDK)
- Braynzarsoft
- directxtutorial.com
- bell0bytes.eu
- 3dgep.com:
- Tutorial points (avoid) an unstructured heap of random documentation without concrete examples or samples.
Other code samples
Books
- Direct3D succinctly | Chris Rose | 2014
Free ebook. For Win 8 and Visual Studio 2012.
- Introduction to 3D Game Programming with DirectX 11 | Franck Luna | 2012
Most cited book by the community, considered to be the reference. Unfortunately it is quite old and code may not work on modern systems such as windows 10 / visual studio 2019 it also uses the obsolete Effects framework. However, there is a bit more up to date code and erratum in the companion site www.d3dcoder.net with fix for visual studio 2015. There is also a git compiling every examples in the book and is a bit more up to date.
- Real-Time 3D Rendering with DirectX and HLSL | Varcholik P. | 2014
The book relies on outdated tools and does not show the entire code of each sample, however, the companion site provides up to date code sample for visual studio 2019.
- Practical Rendering Computation Direct3D 11 |2011
- HLSL Dev cookbook |Doron-Feinstein | 2013
Official Documentation
Direct3D tutorial msdn (Documentation in the Readme.docx) (based on the obsolete SDK) (an OO port)
DX11 Programming Guide
DX11 API Reference
Compute Shader / DirectCompute
- BasicCompute DX11 sample: An up to date CS code sample
- DirectCompute Tutorial: uses deprecated SDK / VS2010
- Tutorial no code sample (2008)
- Direct Compute msdn video lecture series
Documentations
- Nvidia slides, best practice/optimization
- Nvidia DirectCompute programming guide
- GPGPU best practice paper
- Youtube Talk on Optimization
- Compute Shader specifications
- msdn
List of links:
DirectX12
WIP
https://devblogs.microsoft.com/directx/useful-links/
https://nikitablack.github.io/post/directx_12_by_example/
https://digitalerr0r.net/2015/08/19/quickstart-directx-12-programming/
https://www.3dgep.com/learning-directx-12-1/
https://docs.microsoft.com/en-us/windows/win32/direct3d12/directx-12-programming-guide
two comments
“Direct3D succinctly | Chris Rose | 2014”.. Not really that succinct. How about this: D3D Triangle display 40 lines of code
d7samurai - 02/02/2023 -- 21:19