CS 476: Computer Graphics - Module 10 Exercise 1 (1.5 Points)

Developed by Professor Tralie and Professor Mongan.


Exercise Goals

The goals of this exercise are:
  1. Explore how Lambertian illumination can be implemented with vertex shaders
  2. Explore how ideas from physics/optics can be implemented in code
Fill in the vertex shader to complete per-vertex Lambertian illumination (also known as Gouraud Lambertian illumination). Most of the code has been completed for you, but you need to construct the vector from the vertex position in world coordinates to the light position. Then, you need to take the dot product of a normalized version of this vector and the normal direction NT at the surface to compute your diffuse coefficient. If the coefficient is less than 0, you should clamp it at 0
Welcome to our online modules system! Be sure to log in with your Urinus ID before you proceed. For example, Professor Tralie's ID is ctralie. If you are not an Ursinus student, that's fine! Just make something up, and you can still run everything