teaching machines

Feature 3

March 30, 2013 by . Filed under cs455, postmortems, spring 2013.

This feature adds specular lighting to my shuttle and water. The code for this is pretty straight forward, with changes only needing to be made to the fragment shaders. The only difference between the shaders is where the normal comes from. The shuttle’s normals are calculated by ObjUtilites and passed in as a uniform, and the water’s normals are grabbed from a normal map texture.

Here are the two shaders: http://imgur.com/a/gOgpd#0

Here is a video showing the specular lighting effect:

 
[youtube http://www.youtube.com/watch?v=x-A2c4HfHOA?feature=player_detailpage]