CS 476: Computer Graphics - Module 14 Exercise 2 (2 Points)

Developed by Professor Tralie and Professor Mongan.


Exercise Goals

The goals of this exercise are:
  1. Explore how Blinn-Phong shading can be implemented with vertex shaders to make objects shiny
  2. Explore how ideas from physics/optics can be implemented in code
Fill in the vertex shader to complete per-vertex Blinn-Phong illumination. Most of the code has been completed for you, including the Lambertian term from last time. You need to construct the vector h from the vertex position in world coordinates to the eye position. You also need to create the vector dh, which is the normalized vector from the vertex position to the light, reflected about the normal NT. Then, the code is already there to take the dot product of h and dh and to raise them to the shininess factor. Just make sure you clamp it at zero before it gets raised to a power.
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