Shading, Materials, and Textures

Shading

Rasterization solves the problem of what is visible to our camera. Now we discuss the problem of how these visible objects appear to our camera. That is where shading comes in.

Shading is simply the application of mathematical approaches to determine how to display the appearance of objects. There are countless shader models that have been developed, including Phong shading, Blinn-Phong shading, Gouraud shading, Lambert shading, Cook-Torrance shading, Oren-Nayar shading, cel shading, silhouette shading, Gooch shading, and many more.

There are so-called photorealistic approaches that attempt to reproduce real-world physical effects and produce the most realistic appearance possible. There are also non-photorealistic approaches that prefer an artistic style over realness. Next, we explore what components typically make a shader.

Light interaction with objects

How light interacts with the surfaces of objects determines the appearance of that surface. Look closely at how this interaction takes place. The light that strikes a surface is called incident light. The angle at which it arrives with respect to the surface normal is called the incident angle, which we refer to as ωi\omega_i. It then reflects along an angle called the reflection angle, or ωr\omega_r (some light is always absorbed, and there are other interactions like subsurface scattering which is out of the scope of this course). When light strikes a perfectly reflective surface, it reflects along the same angle at which it struck but reflected on the opposite side of the normal. In other words, ωi=ωr\omega_i = \omega_r.

Get hands-on with 1400+ tech skills courses.