GOAL:In this assignment you will learn the basics of OpenGL shader coding by implementing phong and toon illumination with GLSL shaders.
BASIC GRADING:The components of this assignment will be graded as follows:
- 10% Properly turned in assignment
- 30% Render input triangles using vertex shaders for the view transform, in white
- 40% Add Blinn-Phong illumination to the fragment shaders
- 20% Add interactively activated toon shading to your fragment shaders
- Participation credit: You can receive participation credit (outside of this assignment) for posting your result, good or bad, on the class forum!
General notes:You need only display one image. As you progress through the assignment, you can use any improved image to replace the previous (e.g. don't show parts 1, 2 and 3, just 3).
All vertex locations should be described in world coordinates, meaning they do not require any transformation. Locate the eye at (0 0 -2), with a view up vector of [0 1 0] and a look at vector of [0 0 1]. Locate the front clipping plane a distance of 1 from the eye, and the back clipping plane a distance of 3. You may assume that the viewing window is a 2x2 square centered on the front clipping plane, and aligned with world the coordinate axes. With this scheme, you can ensure that everything in the world is in view if it is located in a 2x2x2 box centered at the origin. Use perspective projection. Put a white (1,1,1) light at location (0,5,0). Use obj files from previous assignments.
Part 0: Properly turned in assignmentTurn in both an executable and source. Your assignment should run without any missing libraries, and compile without any missing references. Submit a readme.txt file if there is any configurable behavior. If you wish to claim any extra credit, list those claims in the readme file, along with any needed details.
Part 1: Render using vertex shaders for the view transform, in whiteTransform and project each vertex in a vertex shader. For each fragment, assign it a white color. Don't worry about colors, normals, or depth.
Part 2: Add Blinn-Phong illumination to the fragment shadersAs above, but for each fragment, calculate and output the Blinn-Phong color.
Part 3: Add optional toon shading to your fragment shadersAs above, but for each fragment, apply simple toon shading when the "t" key is pressed. Toon shading quantizes Blinn-Phong results to create an inked look. Blinn-Phong shading reappears when the key is pressed again. No need for inked contour lines yet.
EXTRA CREDIT GRADING:Extra credit opportunities include the following, with others possible with instructor approval:
- 5% support arbitrarily sized images (and interface windows)
- 5% support multiple obj files and arbitrary modeling coordinates
- 5% support arbitrary viewing setups
- 5% support off-axis and rectangular projections
- 5% support multiple lights at arbitrary locations
- 15% add texture mapping
- 15% add inked contouring
- 25% add a mode that uses BSP trees for occlusion rather than z-buffering.