Skip to content
Jeremiah van Oosten edited this page Oct 24, 2020 · 9 revisions

Learning DirectX 12

This is the GitHub repository for the Learning DirectX 12 tutorial series on 3dgep.com:

  1. Initialize DirectX 12
  2. Rendering a Cube
  3. Building a DirectX 12 Framework
  4. Loading Textures and Generating Mipmaps

Motivation

During the process of writing the tutorial series, I also created the DX12Lib in an attempt to simplify working with DirectX 12. The DX12Lib library is written for people just starting out with DirectX 12. I'm a teacher at a games education in Breda, The Netherlands (www.buas.nl) and I primarily teach graphics programming to our 2nd year Bachelor students. DX12Lib was written to help them get started building their game engines using DirectX 12. Ideally, they will use this library as a starting point for their own graphics engines while learning how to work with DirectX 12 and eventually make their own graphics libraries that are better than mine!

With this target audience in mind, DX12Lib was made to be easy to use. Making something easy to use usually means sacrificing performance. For example, instead of using raw pointers, I made the choice to use smart-pointers (ComPtr, shared_ptr and unique_pointer) so that my student's don't have to remember to delete their class instances resulting in memory leaks or unreleased GPU resources.

Dependencies

This project uses several 3rd party open source libraries:

  1. DirectXTex texture processing library
  2. Dear ImGui - Immediate Mode GUI
  3. Open Asset Import Library (Assimp) (Assimp on GitHub)
  4. Gainput (Gainput on GitHub)
  5. spdlog
  6. signals

Samples

I created a few examples to help new users get started with DX12Lib.

01-ClearScreen

This is the "Hello World" example for DX12Lib. It's the minimal example I could think of that shows how to get started using DX12Lib.

Clear Screen Sample.

02-Cube

This example shows how to load index and vertex geometry and setup root signatures, and pipeline state objects. It also shows how to use a constant buffer to rotate the cube and position the camera.

Cube Sample.

03-Textures

This example shows how to work with textures and renders a more complex scene with multiple textured and untextured geometry. It also provides a pixel shader that uses the standard Phong shading model for point, and spot lights.

It also shows how to work with multi-sample render targets to perform Multi-Sample Anti-Aliasing (MSAA).

Textures Sample.

04-HDR

This example loads an High-Dynamic Range (HDR) panorama and converts it into a cubemap to be used as a skybox in the scene. This examples uses an HDR render target and performs Tonemapping on the HDR render target to display the HDR image on screen (using an SDR swap-chain).

HDR Sample.

Clone this wiki locally