This repository contains the up-to-date companion source code for my book Direct3D Rendering Cookbook published in January 2014 by Packt Publishing.
Any questions or issues can be posted in the issues
Update 2017-03-27: this repository has been updated to work with SharpDX 3.1.1. You can find the previous version of the source code that is used in the book here.
To build all projects:
- open the relevant solution,
- restore NuGet packages (right click solution in solution explorer and select Restore NuGet Packages)
- right-click the root node within the Solution Explorer and select Rebuild Solution.
NOTE: If you get an error on Windows 10 and Visual Studio 2015 while trying to create the Direct3D device in debug mode, you may need to enable the DirectX Developer Runtime https://blogs.msdn.microsoft.com/chuckw/2015/08/05/where-is-the-directx-sdk-2015-edition/ or by running the command:
Dism /online /add-capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0
NOTE 2:
If for some reason the MeshContentTask
build target does not
function correctly for you, the compiled assets are available
separately from
OneDrive, they
just need to be copied to the correct build output location. You know if the MeshContentTask is not working when
the *.fbx files do not get converted to *.cmo in your build output directory.
-
All desktop recipes (compatible with VS2012, VS2013 and VS2015):
.\D3DRendering.sln
-
All Windows Store apps recipes (VS2013 only):
.\D3DRendering.vs2013.WinRT.sln
-
D3DCompiler redistributable
.\External
-
Desktop apps
.\Common\Common.csproj
-
Windows Store apps
.\Common.WinRT\Common.WinRT.csproj
-
Building a Direct3D 11 application with C# and SharpDX
.\Ch01_01EmptyProject\
-
Initializing Direct3D 11.1 device and swap chain
.\Ch01_02Direct3D11_1\
-
Debugging your Direct3D application
.\Ch01_03Debugging\
-
Building a simple rendering framework
.\Common\Common.csproj
-
Rendering primitives
.\Ch02_01RenderingPrimitives\
-
Adding texture
.\Ch02_02AddingTexture\
-
Cube and Sphere
.\Ch03_01CubeAndSphere\
-
Material and Lighting
.\Ch03_02MaterialAndLighting\
-
Material and Lighting with cube mapping
.\Ch03_02WithCubeMapping\
-
Load mesh from file
.\Ch03_03LoadMesh\
-
Vertex Skinning
.\Ch04_01VertexSkinning\
-
Bone Animation
.\Ch04_02Animate\
-
Tessellation basics
.\Ch05_01TessellationPrimitives\
-
Tessellation of a mesh
.\Ch05_02TessellatedMesh\
-
Displacement Mapping
.\Ch06_01DisplacementMapping\
.\Ch06_01DisplacementMapping_TangentSpace\
-
Displacement Decals
.\Ch06_02DisplacementDecals\
-
Image processing (compute shaders)
.\Ch07_01ImageProcessing\
-
Physics (with BulletSharp)
.\Ch08_01Physics\
-
Particles (compute shaders with append\consume buffers)
.\Ch08_02Particles\
-
Multithreaded rendering - benchmark
.\Ch09_01Benchmark\
-
Multithreaded Dynamic Cube Environment Map
.\Ch09_02DynamicCubeMapping\
-
Multithreaded Dual Paraboloid Environment Mapping
.\Ch09_03DualParaboloidMapping\
-
Deferred rendering
.\Ch10_01DeferredRendering\
-
NOTE: the textures for the CryTek Sponza scene can be downloaded from the CryTek CryENGINE 3 downloads page or directly here. These should then be placed into the directory:
.\Ch10_01DeferredRendering\textures
The project will also compile and render without these textures
-
-
Direct3D CoreWindow Windows Store app
.\Ch11_01HelloCoreWindow\
-
Direct3D SwapChainPanel Windows Store app
.\Ch11_02HelloSwapChainPanel\
-
Loading resources asynchronously
.\Ch11_03CreatingResourcesAsync\
- NOTE: If you do not see the model, clean and rebuild the
project again. This is because the
.cmo
file does not yet exist the first time you build. Cleaning and building again will correctly add the model to the Windows Store apps' AppX package.
- NOTE: If you do not see the model, clean and rebuild the
project again. This is because the