Review

Well done for getting this far. Looking back over the lighting chapters, you may notice how little of them was about Direct3D itself. Beyond a few details, such as how constant buffers are packed and how to put an array of structs in one, everything we did happened inside pixel shaders: a handful of vectors, some textures, a few formulas. That is the power of shaders. With very little input from the program they can make a scene look lit, and much of what follows in this tutorial works the same way.

Over these chapters we covered colours and what an object's colour means, the Phong lighting model with its ambient, diffuse and specular parts, materials and light properties, diffuse and specular maps, three kinds of light caster, and how to combine many lights in one scene. Before moving on, it is worth playing with all of these: change the lights, the materials and the maps, and build a scene of your own.

Next we leave the cube behind and load real models, which show off these lighting models far better.

Glossary

Credit: this chapter follows LearnOpenGL's Review by Joey de Vries, rewritten for Direct3D 11 and rin. LearnOpenGL's text and code are licensed CC BY-NC 4.0, and so is this page; the wording, code and screenshots here are new, and diagrams marked as LearnOpenGL's are its own.