Normal Mapping

Description

My final project for CSC 473 is a GLSL shader implementation of normal mapping. Its main features are a normal mapped Tyra and a bump mapped ground surface.

I started by creating a GLSL Phong shader with diffuse shading. As you can see below, the model has a very low level of geometric detail and appears to be very flat.

The next step I took was to apply normal maps as textures using OpenGL fixed functionality. For this stage, the shaders are turned off. I did this before attempting the normal map calculation so I could be sure that the textures were mapping onto the model faces correctly.

In the next stage I made a second vertex/fragment shader pair to perform normal mapping. I made them toggleable via the keyboard to easily see the difference between shading with and without normal maps. In the normal map shader, I used the normal offsets stored in the textures to compute lighting per pixel on the Tyra model and plane.

Finally I added camera controls and keyboard controls for moving the view and the light. The white sphere is the light. The red sphere is there to make it easier to see the lighting effect the shader is having on a simple shape without a normal map. In the final shader there is specular and diffuse shading, along with normal map shading.

Resosurces and references

Rost, Randi J. "OpenGL Shading Language, 2nd Edition". Addison Wesley Professional, 2006.

Lengyel, Eric. “Computing Tangent Space Basis Vectors for an Arbitrary Mesh”. Terathon Software 3D Graphics Library, 2001. http://www.terathon.com/code/tangent.html

The brick texture I found using a Google search for free normal maps, while the Tyra model and normal map were provided by Professor Wood.

To load the Tyra mesh, I used "The OpenGL Object Loader"

Binary download (Linux 32 bit)

Download the binary and resource files in gzipped format here.