Assignment 4

Programmable Hardware

You will need the following project files:
assn4a.zip Project source files for part A
(New! - 4/8/2003) Now links properly on machines in OLS 002a
(New! - 4/9/2003) Fixed lighting model
cg_env.reg Registry script to load necessary Cg environment variables
(New! - 4/8/2003) (Required to run Cg in OLS 002a)
 
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

Part A

Implement Phong lighting just as with assignment 3, this time using programmable hardware.

Specifics

The only file you will need to modify for pll but the last requirement for part A is phong.cg. This is a Cg file, written using nVidia's Cg language specification. The program in phong.cg will be loaded on to the vertex unit in the pipeline, and so will be called once for each vertex. The code will recieve the vertex info as an input structure (VSinput) and produce output in the form of an output structure (VSoutput).
Currently, the code in phong.cg simply take the input and outputs a vertex that is colored based on the input normal, and transformed into eye-space. You will need to modify this code to have it (roughly) mirror the OpenGL behavior for up to 4 lights. Since you are not doing Blinn specular, your specular components will be slightly different from OpenGL.

Requirements

Turn-In Instructions

To turn in the project once you are completed, follow these steps:
  1. 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.
  2. Zip up your source files, project, and data files into an archive entitled "ABCD_WXYZ.assn4a.zip", where ABCD and WXYZ are the e-mail IDs of you and your partner (or just yourself if you are working alone).
  3. Upload this archive to your public_html folder on either your blue.unix or CS Domain home directory.
  4. 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.