Getting Started with Direct3D 11


So you’ve downloaded the latest DirectX SDKWindows SDK and start digging through the various tutorials, samples, and documentation, and you are trying to get a handle on where to start learning Direct3D 11…

The best place to start is to learn Direct3D 10. Direct3D 11 is just an extension of Direct3D 10.x, and everything you learn about Direct3D 10 is applicable. These two presentations together cover the basics of using the API, changes to debugging, comparisions to Direct3D 9, and critical performance information for understanding how to optimize the new API.

Introduction to Direct3D 10 (SIGGRAPH 2007)

Windows to Reality: Getting the Most out of Direct3D 10 Graphics in Your Games (Gamefest 2007)

After you are up-to-speed on Direct3D 10, take a little side journey to read up on the changes made for Direct3D 10.1, particularly the concept of ‘feature levels’.

The Evolving Windows Gaming Platform (GDC 2008)

From there you are fully prepared for the ‘delta’ covered in these two presentations on Direct3D 11 proper:

Introduction to the Direct3D 11 Graphics Pipeline (Gamefest 2008)

DirectX 11 Technology Update (Gamefest 2010)

For additional material, see: Feature Levels, Tessellation, DirectCompute, Multithreading, Textures and Block Compression, HLSL, WARP, and Effects.

Math: Since Direct3D 11 does not have the ‘fixed-function’ graphics pipeline of Direct3D 9, the choice of graphics math conventions (left-handed vs. right-handed, row-major vs. column-major matrices, etc.) is entirely up to the developer. DirectXMath can be used to create both Direct3D-style “Left-Hand Coordinate” transformations as well as OpenGL-style “Right-Handed Coordinate” transformations using a row-major matrix convention which can be used directly with row-major shaders or transposed to use column-major shaders. Note that the DirectX Tool Kit and SimpleMath uses the XNA Game Studio convention of “Right-handed, row-major”.

Debugging: Visual Studio 2012 / Windows 8.0 SDK / Visual Studio 2013 / Windows 8.1 SDK (and the legacy DirectX SDK) installs a number of ‘debugging‘ features for development purposes including the “Debug” layers (D3D10SDKLayers.DLL, D3D11SDKLayers.DLL, D3D11_1SDKLayers.DLL, DXGIDEBUG.DLL, D2D1Debug1.DLL) and “Reference” devices (D3D10REF.DLL, D3D11REF.DLL, and D3DREF9.DLL). These cannot be used in released products or Windows Store app submissions as they are not present on end-user (i.e. not developer/test) machines. This means that ‘release production’ builds of your application cannot make use of D3D11_CREATE_DEVICE_DEBUG, D3D11_CREATE_DEVICE_SWITCH_TO_REF, D3D11_CREATE_DEVICE_DEBUGGABLE, D3D_DRIVER_TYPE_REFERENCE, DXGIGetDebugInterface, D2D1_FACTORY_OPTIONS.debugLevel != D2D1_DEBUG_LEVEL_NONE, or D3DDEVTYPE_REF.

Update: For texture processing, see DirectXTex. For sprites, texture loading, ‘basic’ shaders, geometry shapes, a simple font system, and a number of other utilities see DirectX Tool Kit. For mesh processing such as computing vertex normals and vertex cache optimization, see DirectXMesh. All versions of D3DX including D3DX11 are deprecated.

Note: Be sure to read “Where is the DirectX SDK?” to get the latest news on developing for DirectX, particularly if you are using Windows 8.x, VS 2012 or 2013. There is a version of the original DirectX SDK Win32 desktop Direct3D 11 tutorials updated for use with VS 2012/2013 without the requiring the legacy DirectX SDK on the MSDN Code Gallery along with a new version of DXUT, Effects 11, and many of the samples from the DirectX SDK.

If you are primarily interested in learning DirectX 11 for Windows Store app (a.k.a. Metro style app) development, MSDN has a lot of material and there are a number of samples on the Windows Code Gallery including the Windows Store app equivalent of the original DirectX SDK Direct3D 11 tutorials.

Related: Living Without D3DX, Book Recommendations, Anatomy of Direct3D 11 Create Device, Direct3D SDK Debug Layer Tricks, Direct3D Win32 Game Visual Studio template

Comments (26)

  1. Lars Viklund says:

    Speaking of the latest SDK, isn't a new one kind of overdue? Surely there must be some fixes to things like managed PIX and whatnot in the last year?

  2. Asesh says:

    Hey guys, isn't it time to update the SDK? PIX, Dx texture tool crashes a lot. There are so many documentation link errors and so on

  3. walbourn says:

    We don't have anything to announce at this time. We will have more information available at the BUILD conference. What 'crashes' are you seeing with the "Dx texture tool". If you are talking about Dxtex, then likely you are not crashing but trying to open "DX10" extension DDS files which are not supported by the legacy tool.

  4. Lars Viklund says:

    That sounds promising, keep up the good work!

  5. ryan says:

    hey, guys im havin a problem with directx error or some thing like that but now im instalin directx sdk what the different ??

  6. walbourn says:

    Ryan – Are you trying to install an application or game or are you trying to install the DirectX SDK for development work?

  7. mark says:

    i have broblem directx9 not found on xp and i have directx9 only no direct3d wats broblem

  8. walbourn says:

    Mark: I'm not sure what you are asking, but I recommend reading: <blogs.msdn.com/…/not-so-direct-setup.aspx>

  9. Ok. Build have passed. Where is the SDK?

  10. LW says:

    I really want to know about the fate of "DirectX Redist" package… Haven't seen any update since June 2010…

    So… They will discontinue it or "merge" them into Windows (my wish)…?

    Can you tell…? Thanks.

  11. LW says:

    Thank you so much for replying.

    Previously, we can get D3DCompiler_43.dll, D3DX9_43.dll, d3dx10_43.dll, d3dx11_43.dll,… files from installing DirectX Redistributable Package.

    Software developers only have to download DXRedist to include with their games, applications.

    With DirectX SDK being merged into Windows SDK… I'm asking where I can get these above files FROM DIRECTX REDISTRIBUTABLE PACKAGE…

    Seemed like we will get them from SDK. (If I'm wrong, then correct me)

  12. walbourn says:

    D3DCompiler_44.dll and D3DCSX_44.DLL are in the WIndows SDK for Windows 8 and can be redistributed with your application (although they will not pass AppStore validation for Metro style applications).

    XAUDIO2_8.DLL and XINPUT1_4.DLL are included in Windows 8, and neither version is available down-level (i.e. Windows 7)

    If you need XAUDIO2_7, XINPUT1_3, or any flavor of D3DX you still have to use the DirectX SDK release and DirectSetup to deploy it.

  13. LW says:

    Thanks… Thank a lot for replying. It makes my day.

    Best regards.

  14. YuriOh says:

    "XAUDIO2_8.DLL and XINPUT1_4.DLL are included in Windows 8, and neither version is available down-level (i.e. Windows 7)"

    That all is very bad in my opinion….

  15. Mrmohadnan says:

    thank you very much man good job.

  16. shashi says:

    what is D3DERR?

  17. walbourn says:

    Sashi – Do you mean "Where is DXERR"?

  18. Sahil Ramani says:

    Hi Chuck, the first two links

    Introduction to Direct3D 10 (SIGGRAPH 2007)

    Windows to Reality: Getting the Most out of Direct3D 10 Graphics in Your Games (Gamefest 2007)

    seem broken. Or do I need access?

  19. kmo911 says:

    sdk for windows 8 kit anyone ?

  20. walbourn says:

    RE: kmo911

    Sorry, I don't understand the question.

  21. Klimax says:

    I think question is about "old style" SDK distribution. But that's just a guess…

  22. walbourn says:

    In that case… See "Where is the DirectX SDK?"

  23. Suminsky says:

    Would you tell me why the library defaults to row-major matrices if the shader defaults to column major (witch is a good thing, since last I heard it can make operations much faster on it) ? I dont know if transposing every matrix before updating to cbuffers is worth..but even so, wouldnt it be better if the directxmath defaulted to column major?

  24. walbourn says:

    @Suminksy: DirectXMath uses row-major matrices largely as a long-standing convention for DirectX programming which historically uses row-major, left-handed coordinates. There some minor advantages, but its mostly just far too complicated to support both. Secondly, DirectXMath actually inherited that decision from XNAMath, which in turn inherited from xboxmath. Changing it would've radically reduce the amount of client code that used it that would work without major rewrite.

    The fact that HLSL defaults to column-major is a choice that makes sense back in the early days of Vertex Shader 1.x profiles where you really didn't want any extra instructions. Making the matrices column-major in HLSL requires only 3 dot-products instead of 4 to do a typical transformation. Then again, you aren't usually do quite as many complicated matrix operations in HLSL as you do on the CPU. Again, at this point it is more an issue of historical choice than a new design convention.