Assigned: Saturday, March 21, 2008
Due: Monday, April 13, 11:59pm, 2008
To help you in preparing this project, we are providing you with a selection of sample mesh models. Most of them are identical models from MP2, and you are free to use your own models.
[10 points] Mesh Display
- You should display at least one mesh in your program. We should be able to view it from different angles, though it need not be under user control. You can either rotate it periodically, or make use of GUI for rotating the mesh.
- You must setup vertex/fragment shaders for displaying the mesh. No credit will be given for OpenGL fixed-pipeline rendering.
[10 points] Vertex Transformation Animation
[30 points] Per-pixel Phong Shading
- Once you set up a vertex shader, some interesting effects can be generated by simple vertex transformation.
- You should offset your vertices in vertex shader as a function of time to generate some interesting animation. Trivial translation or rotation will not satisfy the requirement.
- For example, you may add an option to translate the vertices of a mesh in the x direction by the sine of their y location phase shifted by time. This should result in a "wavey" version of your mesh.
- You can show off your creativity with some extra effects using transformation.
- Write a shader that computes standard Phong illumination model (ambient, diffuse, specular) on every fragment.
- You should pass vertex normal from vertex shader to fragment shader, and do lighting computation in fragment shader.
- Partial credit will be given if you only implement per-vertex lighting.
[40 points] Tangent Space Normal Mapping
Implement tagent space normal mapping as discussed in the lecture on 3/17. For meshes with both texture coordinates and a normal map image, you can use the Ogre model provided in this MP. You are free to use your own dataset, but their normal map needs to be encoded in tangent spaces instead of the object space.
- The first thing you'll need to do for Tangent Space Normal Mapping is to compute the Tangent, Bi-Normal, and Normal. You should do this on the CPU and pass these to your shader through User Attributes.
- Don't forget to average the TBN matrices of adjacent faces for vertex TBNs. See the slides from 3/17 for the appropriate equations.
- Once you have a correct TBN matrix you should be able to apply the normal map at each fragment. Modify the normal based on the interpolated TBN and the corresponding normal map texel.
- For your reference, the expected results are demonstrated here. The left image shows smooth shading without normal mapping, and the right one shows the normal mapped result.
[10 points] Code Design and Documentation
Your code should be well designed and well written. It should be easy to follow the logic of your program. A readme file should explain the features and special instructions ( if any ) to run your code.
Important: Follow all handin instructions carefully. You may lose most or all points for failure to follow these instructions or if you do not hand in all required files.
You must turn in the following files:
To actually turn in your finished project, follow the hand-in instructions that we have provided.
Code-sharing, working together with peers, and copying code from other sources are only allowed under restricted conditions. Make sure you read the code-sharing policy for details.
Significant reductions will be imposed for projects that do not compile. If a project is handed in late, there will be a 20 percent reduction for every 24-hour period after the deadline.