CSE 40166 / 60166 - Computer Graphics

|    Home  |   Syllabus  |   Assignments  |   Schedule  |   Resources   |

Homework 7 - Shaders

This assignment is due by November 20, 2012 by 11:59pm.


Part I - A Whiter Shade of Pale

For this assignment, you will need to create both a vertex shader and a fragment shader. The details of each are described below. Further, create a mood in your scene with proper lighting and texturing.

Part IA - Vertex Shader: Pose-Based Animation

As seen in class, you will need to implement a mesh deformation vertex shader. This shader should interpolate between two sets of vertices to perform pose-based animation. There are many applicable models to choose from on the Resources page. Any of the animal poses, armadillo deformations, or Waddles will work. (Though the armadillo deformations are likely too large to render in a reasonable time) You need to ensure that the two model poses you are interpolating between have the same number of vertices. Thanks to Sumner and Popovic for making their mesh deformations available.

Make Waddles go from boring to sassy!

How you choose to implement the corresponding poses is up to you. With all the models you may assume that Point 0 corresponds to Point 0 as does Point 249 corresponds to Point 249 etc. It is possible to use the existing CSE40166::Object class. Or you can create your own Mesh class that reads in an .obj file and stores only the vertices. Then you can extend this to a PoseableMesh class that stores two sets of vertices that correspond. Be sure to look at Object.cpp in the CSE40166 library for how to properly read a .obj file. The final used implementation is up to you.

Part IB - Fragment Shader: Illumination Models

Beyond implementing the fixed-function pipeline and texturing if needed, implement one of the lighting techniques we discussed in class. Your options include:
  • Cel/Toon Shading
  • Fresnel Shading / Angle of Incidence
  • Anisotropic Shading
  • Normal Mapping
  • Specular Mapping
There are some normal maps and specular maps (and anisotropic maps) on the Resources page to get you started. Others can be found by searching online (such as The 3D Studio). This fragment shader could apply to your object (in the case of cel/toon, fresnel, or anisotropic shading) or to other objects in your scene (skybox, columns, etc. for the case of normal and specular mapping). Whichever lighting technique you implement in the fragment shader, make sure that the corresponding vertex shader passes the necessary information as varyings appropriately. The links provided on Piazza should prove helpful in these techniques.

Part IC - Set the Mood

Choose appropriate textures and lighting/materials to set the scene. COLOURlovers has many color palettes that have complimentary colors. Find colors that fit your theme. Does your creature exist in a dark scary world? Or a bright happy rainbows and puppy dogs world?


Part II - Website

Update the webpage that you submitted with HW6 to include an entry for this homework assignment. As usual, include a screenshot (or two) and a brief description of the program, intended to showcase what your program does to people who are not familiar with the assignment.


Documentation

With this and all future assignments, we expect you to appropriately document your code. This includes writing comments in your source code - remember that your comments should explain what a piece of code is supposed to do and why; don't just re-write the code says in plain English. Comments serve the dual purpose of explaining your code to someone unfamiliar with it and assisting in debugging. If you know what a piece of code is supposed to be doing, you can figure out where it's going awry more easily.

Proper documentation also means including a README.txt file with your submission. In your submission folder, always include a file called README.txt that lists:
  • Your Name / netID
  • Homework Number / Project Title
  • A brief, high level description of what the program is / does
  • A usage section, explaining how to run the program, which keys perform which actions, etc.
  • Instructions on compiling your code
  • Notes about bugs, implementation details, etc. if necessary


Grading Rubric

Your submission will be graded according to the following rubric:

PercentageRequirement Description
40%Vertex Shader performs pose-based animation by interpolating between two sets of vertices.
40%Fragment Shader implements an advanced lighting technique beyond the fixed-function pipeline.
10%The textures, lighting, and materials chosen convey a particular mood to the scene.
5%World is placed within a Sky Box.
5%Submission includes source code, Makefile, and README.txt.
Source code is well documented. Webpage named <afsid>.html submitted and updated with screenshot from latest assignment. Submission compiles and executes in the lab machine environment.


Submission

Please update your Makefile so that it produces an executable with the name hw7. When you are completed with the assignment, submit the source code, Makefile, and READEME.txt to the following directory:

/afs/nd.edu/coursefa.12/cse/cse40166.01/dropbox/<afsid>/hw7/

Similarly, title your webpage <afsid>.html (e.g. jpaone.html) and submit it to:

/afs/nd.edu/coursefa.12/cse/cse40166.01/dropbox/<afsid>/www/

Place any screenshots or other images used on the webpage in:

/afs/nd.edu/coursefa.12/cse/cse40166.01/dropbox/<afsid>/www/images/

This assignment is due by November 20, 2012 by 11:59pm.