Sheet 04: Texturing
Exercise: Lighting details (15 Points)
In the previous assignments, a lot of repetitive code had to be written to create different shader programs, buffers, and arrays. This can be tedious if there are a lot of resources to handle, and it's a good idea to abstract this into classes. Luckily, we have provided you with several classes to handle all kinds of OpenGL resources. Take a look at the assignment code. It re-implements part of the teapot scene from the previous assignment but now uses those classes to simplify resource creation and usage. To demonstrate the texture classes the code loads a single texture and maps it onto the ground plane. In order to increase detail in our teapot scene add more texture mapping capabilities to your program. In addition to texture for the diffuse Stones_Diffuse.png part use a second texture Stones_Specular.png for the specular illumination components of the ground plane. The textures should span the entire ground plane. Make sure to enable bilinear texture interpolation for mini- and magnification and use the diffuse and specular texture lookups for a proper phong lighting calculation.
You do not need to modify the code in Utils.
As in the previous assignment: Do not change the initial viewing angle and light source position of the scene for your submission!
Figure 1: Solution to the first part.
Exercise: Normal details (15 points)
To further refine your scene's small-scale details, integrate normal mapping. Use the following normal maps for the ground plane Stones_Normals.png and the teapot UDE_Normals.png. Ensure you enable texture repeat mode for the teapot's texture. With correct implementation, the stones will appear more prominent on the ground plane under steep viewing angles and suitable lighting, and the UDE logo will be visibly engraved on the blue teapot.
Solution.
Use the mouse to interact with the scene.
Spacebar: Toggles animation on/off
R key: Resets the animation and the view
Text description and demo controls
A blue teapot stands over a stone-textured ground plane. Diffuse and specular textures determine the ground color and the strength of reflected highlights. Normal maps change the lighting response without changing the geometric silhouette.
With normal mapping, the stones appear raised under suitable lighting, especially at oblique viewing angles. A repeating UDE logo appears engraved in the teapot surface. These are shading details rather than additional triangles in the mesh.
Focus the demo with Tab. Space starts or pauses the light animation; R resets animation and view. Camera rotation and panning currently require mouse dragging.