Skip to content

Using advanced shaders

Chuck Walbourn edited this page Aug 8, 2016 · 34 revisions

In this lesson we learn about other built-in shader types and some of their uses.

Setup

First create a new project using the instructions from the first two lessons: The basic game loop and Adding the DirectX Tool Kit which we will use for this lesson.

Environment mapping

Start by saving wood.dds and cubemap.dds into your new project's directory, and then from the top menu select Project / Add Existing Item.... Select "wood.dds" and click "OK". Repeat for "cubemap.dds"

UNDER CONSTRUCTION

More to explore

  • The NormalMapEffect is similar to the BasicEffect with the addition of a normal texture map and an optional specular texture map. This requires the input layout to contain vertex tangents which can be included when exporting an .SDKMESH via the Content Exporter (see -normalmaps), or can be computed using DirectXMesh.

  • DualTextureEffect is used to render a material with two textures applied. This requires the input layout to contain a second set of texture coordinates. This does not perform vertex or per-pixel lighting, as the second texture is most often a lightmap with statically computed lighting information. .SDKMESH and the Content Exporter support exporting light-mapped models which utilize this effect (see -lightmaps).

  • The AlphaTestEffect is used to perform pixel rejection based on an alpha reference value and function selection. It's primarily to implement techniques that relied on legacy Direct3D 9 alpha testing render state. This effect is independent of the depth/stencil testa set in D3D12_DEPTH_STENCIL_DESC.DepthFunc and StencilFunc.

Further reading

DirectX Tool Kit docs Effects

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Xbox One
  • Xbox Series X|S

Architecture

  • x86
  • x64
  • ARM64

For Development

  • Visual Studio 2022
  • Visual Studio 2019 (16.11)
  • clang/LLVM v12 - v18
  • MinGW 12.2, 13.2
  • CMake 3.20

Related Projects

DirectX Tool Kit for DirectX 11

DirectXMesh

DirectXTex

DirectXMath

Tools

Test Suite

Model Viewer

Content Exporter

DxCapsViewer

See also

DirectX Landing Page

Clone this wiki locally