Last time, we finished up our exploration of the examples from Chapter 6 of
Frank Luna’s Introduction to 3D Game
Programming with Direct3D 11.0
. This time, and for the next week or so, we’re
going to be adding lighting to our repertoire. There are only two demo applications on tap
in this chapter, but they are comparatively meatier, so I may take a couple posts to describe
each one.
First off, we are going to modify our previous Waves Demo to render using per-pixel lighting,
as opposed to the flat color we used previously. Even without any more advanced techniques,
this gives us a much prettier visual.
To get there, we are going to have to do a lot of legwork to
implement this more realistic lighting model. We will need to implement three different
varieties of lights, a material class, and a much more advanced shader effect. Along the
way, we will run into a couple interesting and slightly aggravating differences between the way
one would do things in C++ and native DirectX and how we need to implement the same ideas in C#
with SlimDX. I would suggest that you follow along with my code from https://github.com/ericrrichards/dx11.git.
You will want to examine the Examples/LightingDemo and Core projects from the solution.