Assignment 4

Programmable Hardware

You will need the following project files:
assn4bc.zip Project source files for parts B and C
(New! - 4/21/2003) Now links properly on machines in OLS 002a
cg_env.reg Registry script to load necessary Cg environment variables
 
These links may also prove useful:
Cg Toolkit For working at home -- already installed in OLS 002a
Cg Toolkit Reference Included in the Cg Toolkit
NV30 Emulator Required to run the shaders in this assignment
(Will only run on computers with GeForce graphics cards)
Note: This assignment will require the use of the NV30 emulator, included with the Cg toolkit

Part B

Implement your Phong lighting algorithm as a combination of vertex and fragment shaders, using the framework provided. This framework will require the use of the NV30 emulator included with the Cg toolkit.

Specifics

It should be noted that some calculations, such as the V and L vectors, can be done in the vertex pipeline to make your program more efficient. The vectors can then be passed, via an output structure, into the fragment program for use in calulating the lighting equation. One way to pass the vectors to the the fragment pipe is to add elements to the output structure, and bind them to one of the pre-defined registers (TEXCOORD0-TEXCOORD4, for example).

Requirements

Part C

Implement a three-tone cartoon shader as combination of vertex and fragment shaders, similar to 4b.

Specifics

You should use the same given framework to implement this assignment. Three tone toon shading involves performing caluclations of components (diffuse, specular) in a manner very similar to Phong lighting. The difference is that, based on a comparison of each of these components to certain thresholds, a hard cut is made between which of four colors (three tones and a silhouette color) is used.

Requirements

Turn-In Instructions

To turn in the project once you are completed, follow these steps:
  1. You should have two separate subfolders in your submissions: assn4b and assn4c.
  2. Delete the "debug" directory, as well as any included .exe files, like fluid.exe for example. All you should be submitting should be source, models, and the visual studio project files.
  3. Zip up your source files, project, and data files into an archive entitled "ABCD_WXYZ.assn4bc.zip", where ABCD and WXYZ are the e-mail IDs of you and your partner (or just yourself if you are working alone).
  4. Upload this archive to your public_html folder on either your blue.unix or CS Domain home directory.
  5. Send an e-mail to Prof. Luebke (CC'd to the TA) with the subject "Assignment 4a turn-in", containing the names of you and your partner, and a link to the file.