Direct3D11 - microsoft/DirectX-SDK-Samples GitHub Wiki
Direct3D 11 Samples
See directx-sdk-samples for fully modernized version of Direct3D 11 samples.
AdaptiveTessellationCS40 (UPDATED)
AdaptiveTessellationCS40 demonstrates some adaptive tessellation techniques implemented using Compute Shader 4.0. You can use the radio buttons in the user interface to switch which tessellation schemes to use and observe how the tessellation pattern changes. The tessellation schemes implemented here are now identical to the triangle patch-based tessellation of Direct3D11 Tessellator Stage. So potentially the technique here could be a fallback solution for future games or other applications that use DirectX 11 hardware tessellation when they are running on devices that support only DirectX 10.x, because Compute Shader 4.0 runs on most DirectX 10.x-capable hardware.
Compute Shader allows more general algorithms to be implemented on the GPU. While the fully featured Compute Shader 5.0 requires Direct3D 11 hardware, a subset of that—Compute Shader 4.x—runs on existing Direct3D 10-compatible hardware, if the driver supports it.
BasicCompute11 (UPDATED)
This sample shows the basic usage of DirectX11 Compute Shader (aka DirectCompute) by implementing array A + array B.
BasicHLSL11 (UPDATED)
This Direct3D 11 sample shows a simple example of using the High-Level Shader Language (HLSL).
BC6HBC7EncoderCS (UPDATED)
This sample implements BC6H/BC7 encoding/decoding using DirectCompute 4.0 acceleration. BC6H and BC7 are two new block-compressed texture formats introduced in Direct3D 11 that target much better visual quality than previous BC texture formats.
Note that this functionality has been integrated into the DirectXTex library.
CascadedShadowMaps11 (UPDATED)
This sample demonstrates the cascaded shadow map (CSM) algorithm. This algorithm also demonstrates several techniques that can be used to make efficient use of the shadow map.
ComputeShaderSort11 (UPDATED)
This sample demonstrates the basic usage of the DirectX 11 Compute Shader 4.0 feature to implement a bitonic sort algorithm. It also highlights the considerations that must be taken to achieve good performance.
ContactHardeningShadows11 (August 2009)
This sample, contributed by AMD, presents a Direct3D 11 Shader Model 5.0 accelerated technique that uses non-stationary, dynamic-weight matrices for unique per-sample filter weights (these don't necessarily represent a seperable filter) for a contact hardening shadow effect
DDSWithoutD3DX11 (UPDATED)
DDS texture loading without using the D3DX helper functions.
Includes the fixes from this blog post. It is strongly recommended you make use DDSTextureLoader.
DecalTessellation11 (June 2010)
This sample, contributed by AMD, presents a technique for applying tessellation with displacement mapping using decals. Given an arbitrary mesh, the sample uses a ray cast to find the location of where a ray from the eye point intersects the mesh. A decal is placed at the intersection and the mesh is rendered with tessellation so that the triangle density is high enough for accurate displacement mapping. One possible use for this technique is to represent realistic looking 3D damage on objects.
DetailTessellation11 (August 2009)
This sample, contributed by AMD, demonstrates the use of detail tessellation for improving the quality of material surfaces in real-time rendering applications.
DynamicShaderLinkage11 (UPDATED)
This Direct3D 11 sample demonstrates use of Shader Model 5 shader interfaces and Direct3D 11 support for linking shader interface methods at runtime.
EmptyProject11 (August 2009)
This sample is a bare-bones DXUT application provided as a convenient starting point for your own Windows desktop Direct3D 11 application. This is the minimum needed to get a DXUT-based application running, but it does nothing but clear the screen to a background color. This sample also includes a Direct3D 9 fallback and uses the older DXUT11.
EmptyProject11.1 (NEW)
Version of EmptyProject11 that uses the latest DXUT and does not have a Direct3D 9 fallback.
FluidCS11 (UPDATED)
This sample illustrates how to implement a simple optimized 2D particle fluid simulation. It uses a technique called Smoothed Particle Hydrodynamics to perform the fluid simulation based on the paper “Particle-Based Fluid Simulation for Interactive Applications” by Matthias Müller. To further optimize the simulation for the GPU, a spatial grid is implemented based on the article “Broad-Phase Collision Detection with CUDA” by Scott Le Grand.
HDRToneMappingCS11 (UPDATED)
HDRToneMappingCS11 shows how to setup and run the compute shader(CS), which is one of the most exciting new features of Direct3D 11. Although the sample only utilizes the CS to implement HDR tone-mapping, the concept should extend easily to other post-processing algorithms, as well as to more general calculations.
MultithreadedRendering11 (UPDATED)
This is the DirectX SDK's MultithreadedRendering11 sample updated to use Visual Studio 2015 and the Windows SDK 8.1 without any dependencies on legacy DirectX SDK content.
NBodyGravityCS11 (UPDATED)
This is one of the Compute Shader demos shown at GDC09. This sample shows an N-Body particle system implemented using Compute Shader 4.0. Because of benefits brought by Compute Shader, it achieves significantly higher frames per second than the previous NBodyGravity sample under the Direct3D 10 section, which was implemented using Direct3D 10 Pixel Shader and Geometry Shader.
OIT11 (UPDATED)
Demonstrates a technique for achieving order-independent transparency in Direct3D 11.
PNTriangles11 (August 2009)
This sample, contributed by AMD, presents a technique for achieving smooth surfaces from the position and normal data of a low density mesh.
SimpleBezier11 (UPDATED)
DirectX 11 introduces three new stages to the graphics pipeline: the Hull-Shader Stage, the fixed-function Tessellator Stage, and the Domain-Shader Stage. Together, these stages operate in between the vertex shader and geometry shader to provide the flexibility to implement a variety of different surface representations, including Bezier patches and subdivision surfaces. This sample demonstrates the basic usage of the DirectX 11 tessellation feature to render a simple cubic Bezier patch.
SimpleSample11 (August 2009)
Basic starting point for new Direct3D 11 samples. This sample also includes a Direct3D 9 fallback and uses the older DXUT11.
SimpleSample11.1 (NEW)
Version of SimpleSample11 that uses the latest DXUT and does not have a Direct3D 9 fallback.
SubD11 (UPDATED)
The SubD11 sample implements the algorithm described in the paper "Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches" by Charles Loop and Scott Schaefer. This sample is similar to the DirectX SDK SubD10 sample, except that it has been enhanced to take advantage of three new Direct3D 11 pipeline stages: the hull shader, the tessellator, and the domain shader.
VarianceShadows11 (UPDATED)
VarianceShadows11 demonstrates how to integrate cascaded shadow maps with variance shadow maps.
This sample demonstrates how to use the cascaded shadow map (CSM) algorithm with the variance shadow map (VSM) algorithm. This sample is an extension of the CascadedShadowMaps11 sample. Percentage closer filtering has been removed and variance shadow maps have been added.
WindowsTouch (August 2009)
This Direct3D 11 sample demonstrates how to use the WM_TOUCH messages in an RTS style game.
For modern versions of Windows, touch should be implemented using
WM_POINTER
.
Effects for Direct3D 11
BasicHLSLFX11 (NEW)
This sample loads a mesh, create vertex and pixel shaders from files, and then uses the shaders to render the mesh.
This is a Direct3D 11 version of the Direct3D 10 BasicHLSL10 sample. BasicHLSL11 is a version of the same sample that does not make use of Effects 11.
DynamicShaderLinkageFX11 (UPDATED)
This sample loads a mesh, create vertex and pixel shaders from files, and then uses the shaders to render the mesh.
This is an Effects 11 version of the Direct3D 11 sample DynamicShaderLinkage11.
FixedFuncEMUFX11 (NEW)
This sample attempts to emulate certain aspects of the Direct3D 9 fixed function pipeline in a Direct3D 11 environment.
This is a Direct3D 11 version of the Direct3D 10 FixedFuncEMU sample.
InstancingFX11 (NEW)
This sample shows an example of using instancing to render a complex scene using few draw calls.
This is the Direct3D 10 Instancing sample updated for Direct3D 11.
Tutorials (UPDATED/NEW)
Tutorials 1 through 7 are the DirectX SDK's Direct3D 11 tutorial series updated to use the Windows SDK without any dependencies on legacy DirectX SDK content.
Tutorials 8 - 10 are DXUT for Direct3D 11 framework tutorials.
Tutorials 11 - 14 are Effects 11 library tutorials.