September 2018
Intermediate to advanced
472 pages
15h 36m
English
As covered in the Implementing the Phong reflection model recipe in Chapter 3, The Basics of GLSL Shaders, the specular term in the equation involves the dot product of the vector of pure reflection (r), and the direction toward the viewer (v):
In order to evaluate the preceding equation, we need to find the vector of pure reflection (r), which is the reflection of the vector toward the light source (s) about the normal vector (n):

We can avoid calculating r by making use of the following observation. When v is aligned with r, the normal vector ...
Read now
Unlock full access