These directories contain GLSL examples from the OpenGL course at SIGGRAPH08 The directories contain the application source code, the shaders, a Mac OS X makefile, and a Mac binary. The code should compile under Windows. The programs use the GLUT library for interfacing with the window system. The major difference between the Mac and linux/Windows code is that the Mac stores the GLUT include under and GLUT framework (GLUT/glut.h) whereas on linux/Windows the include is GL/glut.h. The major difference between Mac/linux and Windows is that OpenGL on Windows needs the entry points for recent versions of OpenGL. You can use the GLEW (OpenGL Extension Wrangler) library that you can get over the Internet. For more information, see my book support for the fourth edition of Interactive Computer Graphics (Addison-Wesley) at www.cs.unm.edu/~angel MESH: The application defines a flat rectangular mesh and displays it as set of edges of the rectangles so no lighting is needed. The vertex shader changes the height of the mesh sinusoidally. The fragment shader is a simple pass through shader. I added a simple trackball interface to allow you to rotate the mesh. WAVE: In this application the mesh is filled so we need to add lightng. The vertex shader computer diffuse and specular lighting. The material and light properties are specified in the application. An elapsed time variable is passed from the application program to the vertex shader and varies the heights of the mesh sinusoidally. The fragment shader is a pass through shader. CARTOON: In this example we use shaders to do "cartoon shading." In nonphoto the vertex shader computes the diffuse lighting term but then thresholds it to only two colors. We also computer a black silhouette edge by looking at where the view vector is almost perpendicular to the normal. The elapsed time is used to rotate the light source. Again the fragment shader is a pass through shader. In nonphoto the shading is rough since it is done on a vertex by vertex basis. In nonphoto2 we do the shading on a fragment my fragment basis and get a smoother result. CUBEMAP: A cubemap texture is set up in the application and applied in the fragment shader. Each side of the cube is a sold color so we need only one texel for each of the six faces. The cubemap is used as a refection map. The vertex shader computes the reflectiion vector for each vertex and passes it the rasterizer. The fragment shader used the interpolated reflection map to get the texture coordinates needed to get the texture color from the cubemap. BUMPMAP: The idea behind bump mapping is that we can give the appearance of a surface of great complexity by varying the normal vector on a fragment by fragment basis. Although the mathematics is more complex than the previous examples we can note the following: (a) the object is once more just a flat mesh (b) the application needs to send a tangent vector to the vertex shader so the vertex shader can set up a local coordinate system to use for the shading calculation. (c) the partial derivatives of the variation in the normals is stored as a texure that is available to the fragment shader. The light source position varies in time so when you run the program you get the appearance of a surface with two heights even though the mesh is flat.