Normal Mapping

Greg Gire

Final Project under Professor ZoŽ Wood
CSC 572 (Fall 2008)



Overview

The goal of this project was to apply a normal map to a simplified mesh using shaders. Source code for the program was written in C, using both the OpenGL and CG libraries.

The Program

The progam is able to display three different images of a T-Rex: A simplified mesh, the mesh with a normal map textured onto it, and finally the normal mapped mesh.


Simplified Mesh
Simplified Mesh

Textured Mesh
Textured Mesh

Normal Mapped Mesh
Normal Mapped Mesh

Commands

ESC: Quits the program
LEFT MOUSE BUTTON: Rotates the model around the X-axis
RIGHT MOUSE BUTTON: Rotates the model around the Y-axis
MIDDLE MOUSE BUTTON: Rotates the model around the Z-axis
r: Resets the lighting, position, and rotation of the T-Rex
1: Displays the simplifed mesh
2: Displays the texture mapped mesh
3: Displays the normal mapped mesh
a: Moves the light to the left
d: Moves the light to the right
w: Moves the lihgt up
s: Moves the light down
q: Moves the light into the screen
e: Moves the light out of the screen
x: Moves the model to the left
X: Moves the model to the right
y: Moves the model down
Y: Moves the model up
z: Moves the model into the screen
Z: Moves the model out of the screen
-: Inverts the rotation angle

Future Work

The main purpose of this project was to learn how to use shaders and normal map so that I could determine an error metric signifying whether a normal map looks good on a mesh. Therefore, my future work in graphics and on my Master's thesis will be based around this premise. The first step in accomplishing this is directly comparing a high resolution model to a simplified mesh that is normal mapped. Each model's frame data can be captured under the same lighting and translation positions and their pixels can be directly compared resulting in a percentage on how well the models match at that particular position. The next step would be to compare the normal that is being applied to each pixel to the normal of the face that contains that pixel. If the angle between the pixel normal and the normal of simplified mesh face is outside a particular range, that pixel could be colored specifically to indicate that the normal will not map correctly to that specific face. Finally, the goal would be to integrate this error metric into a simplifier, so that a complex mesh could be simplified specifically so that it will display the best possible normal map.

Downloads

Executable File - .rar file that contains an executable and its required support files