P A05-Normal Map
- PA05 Normal Mapping is due on Nov 29, 2016, 11:59pm
- This assignment will help you deepen the understanding of the following topics
- OpenGL pipeline
- OpenGL shading language
- Basic Lighting (Diffusion, Specular, Ambient, directional light, point light, spot light, etc)
- Texture mapping
- Normal mapping
- Tangent-space coordinate
- Code: cs451-PA05.7z
- Code: cs451-PA05-solution.7z (same password as before)
- What to submit
- Your code (with everything)
- All images that you created. Make sure that you name your images as follows
- Texture color map (cs451_pa05_color.jpg)
- Normal map (cs451_pa05_normal.jpg)
- Image rendered with color map (cs451_pa05_texture.jpg)
- Image rendered with normal map + color map (cs451_pa05_bump.jpg)
- README.txt file in cs451-PA05 folder with the following information
- The OS and compiler that you compile your code
- How to build your program
- Tasks that you completed
- Tasks that you started but did not complete
- Tasks that you did not start
- What are the known bugs in your code?
- How to submit
- Submit all source code and README.txt in a file named cs451_pa05_[your last name].zip on Blackboard
- A very simple GLSL cheat sheet
Tasks
- Task 1 (10%): Create a images
- Use your camera to take a picture of a surface that has large geometric variance. This picture is called Color map.
- Use http://www.crazybump.com/ to create
- a normal map
- Note: Crazybump only works on Windows and Mac. If you work on Linux and have no access to either Windows or Mac, please let me or your TA know.
- Task 2 (20%): Implement GLSL code that renders a given shape using per-pixel spot light shading (with diffusion and specular lights)
- Hint: Go through the tutorials in the following links
- Task 3 (30%): Implement GLSL code that textures a given shape using the Color map
- Hint: Go through the tutorials in the following links
- Task 4 (30%): Implement GLSL code that creates bump mapping on a given shape using the Normal map
- Hint:
- you are allowed to modify shaders that you found online but cite the sources
- make sure that your normal map is on the tangent space (i.e., not in object/world space)
- Hint:
- Task 6 (10%): Provide a README.txt described above
Examples
- I took an image of a towel of mine and used CrazyBump to generate normal and displacement maps (from left to right):
- To run your code with only spotlight shading:
- > normalmap ./models/essai.obj
- To run your code with texture mapping and spotlight shading:
- > normalmap -texture ./textures/towel_texture.jpg ./models/essai.obj
- To run your code with normal mapping+texture mapping+spotlight shading:
- > normalmap -texture ./textures/towel_texture.jpg -normalmap ./textures/towel_NRM.jpg ./models/essai.obj
- The following image shows the per-vertex tangent space coordinates
- When something went wrong, it's likely that you will see this: