CMSC 435/634: Introduction to Computer Graphics

Assignment 5
Due November 25, 2014

The Assignment

For this assignment, you will start with OpenGL code for assignment 3 or 4 to render a terrain that is partially wet and reflective.

The new terrain.mtl file checked into your assn5 directory refers to a texture, pebbles-a.pam, which includes a height value in the alpha channel. You will use this to render a wet surface in the space between the rocks, while preserving the normal appearance for rocks themselves. You can choose how much should be wet or dry, but must choose a threshold that shows both.

For your surface shading model, the wet regions should use the Fresnel reflectance factor based on the surface normal (NOT half-vector) to blend between a reflected color and the normal surface color. Your wet surface should use a reflection based on the cube environment map included in the files snow0.pam-snow5.pam. The existing C++ texture code only loads 2D textures, so you will need to make the necessary changes to also load the cube map textures into a samplerCube or samplerCubeArray.

Required for 634; Extra credit for 435

Make the surface get more and less wet over time. For example, you could change the wet/dry height threshold by sin(time), with time based on glfwGetTime and passed as a uniform into the shader. Allow the user to pause and resume the time-varying changes when the user presses the 't' key.

Students in 634 are required to include a time-varying component in their shader. Students in 435 can attempt to add the time-varying component for up to 5 points of extra credit. As usual, extra credit is only available if you submit by the original deadline or use your free late, and mention the extra credit in your README.

What to turn in

Turn in this assignment electronically by pushing your source code to your assn5 GIT directory by 11:59 PM on the day of the deadline. We will be looking for multiple checkins documenting your development process.

As always, double check that you have submitted everything we need to build and run your submission, but no generated files (.o's, executables, or images). Be sure to include a readme.txt file telling us about your assignment. Do not forget to tell us what (if any) help did you receive from books, web sites or people other than the instructor and TA.

Be sure to include the details of the system you used for the assignment in your README in case we have problems.