Games for Windows and the DirectX SDK blog

Technical tips, tricks, and news about game development for Microsoft platforms including desktop, Xbox, and UWP


Project maintained by walbourn Hosted on GitHub Pages — Theme by mattgraham
Home | Posts by Tag | Posts by Month

Getting Started with Direct3D 11

direct3d

Originally posted to Chuck Walbourn's Blog on MSDN,

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 DirectX Tool Kit tutorials and the Direct3D Game VS Templates are a good place to start. You should also take a look at the Introductory Graphics samples on Xbox-ATG-Samples.

When looking at presentations, a good place to start is to review the Direct3D 10 material especially if coming from a background of knowing Direct3D 9. 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, comparisons to Direct3D 9, and critical performance information for understanding how to optimize the new API.

Introduction to Direct3D 10 (SIGGRAPH 2007) link

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

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) link

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) link

DirectX 11 Technology Update (Gamefest 2010) link

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.

On Windows 10, the debug layer is not installed by any SDK. Instead you enable the Graphics Tools Windows Optional Feature. See this blog post.

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