Math · Intermediate · Lesson 8 of 8
Light and Shade
Lighting with dot products
An interactive lesson with 8 steps, about 7 minutes: you predict, drag and solve, with instant feedback on every answer. It runs in your browser and needs JavaScript.
What you’ll learn
- Lambert: matte brightness = max(0, n · l) = cos of the angle to the light.
- Phong highlights: (r · v)^s, where r = 2(n · l)n − l.
- Higher shininess s gives smaller, sharper highlights.
Steps
- The cosine law
- Lighting a sphere
- A dot product
- Half brightness
- Shiny highlights
- Ray tracing
- The reflected ray
- Just off the highlight