EECS 487, Fall 2005

Project 2: Shading




Overview

In this project you will implement the OpenGL lighting model in 3 ways: first, by making the necessary calls to OpenGL to use its built-in lighting computations; second, by computing the OpenGL lighting model in software and passing the results to OpenGL in the form of pre-computed vertex colors; and last, by implementing lighting calculations in OpenGL Shading Language (GLSL), making use of programmable graphics hardware.  You will finish up by writing a few other shaders in GLSL.

You are given support code for this project and will need to
  1. link to the jot library (the same as for project 1),
  2. copy the project support code and edit the makefile to indicate jot installation information, and
  3. implement the missing functionality.
For more information about jot, see the instructions given in project 1.


Support Code

Copy the project support code to your local machine using one of the following commands:
Remote session for Linux/Unix/SunOS/MacOS users:
  % scp -r red.engin.umich.edu:/afs/engin.umich.edu/class/perm/eecs487/proj2 .

OR

  % rsync -av -e ssh red.engin.umich.edu:/afs/engin.umich.edu/class/perm/eecs487/proj2 .

Windows users can use set up an sftp session to red.engin.umich.edu and grab the files from the above path or, on (CAEN) machines with AFS mount, copy the files from:
    K:\perm\eecs487\proj2

The C++ source code files are: p2.C, shaders.H and shaders.C. The GLSL shader files are: simple.vp, simple.fp, lighting.vp, and lighting.fp. Read through these files to get familiar with them, then implement the following missing functionality:

OpenGL lighting:
Software lighting:
GLSL: (Note: for this part you need OpenGL 1.5 or 2.0.)
Lighting design:
Write-up:
Code quality:
  1. Comment your code reasonably, particularly your design decisions and choice of approach.
  2. Modularize your code: use a suitable number helper functions with descriptive names.
  3. Use descriptive variable and function names: apply a suitable tradeoff between symbol-length and descriptiveness.
    Bottom line: Make your code readable! 10 points


Building and running the code:

Edit the provided Makefile to define the path to your jot directory. [On Windows, you must use a DOS prompt, and you must first run the setup.bat script in your jot directory.] Then you should be able to compile the program, as follows:
  % cd proj2
% make
This results in an executable named p2 which takes model files as command-line arguments.


Models

A CVS repository of models has been set up on CAEN servers. To check out your own copies of the models, do the following:

  % cvs -d :ext:<your-uniqname>@red.engin.umich.edu:/afs/engin.umich.edu/class/perm/eecs487/cvsroot checkout -P models

Students are welcome to share models with the class by checking them into the repository. (Use binary mode in cvs: cvs add -kb mesh.obj). Please stick to model files that are in the public domain (or that you made yourself). Currently jot can read .obj files as well as native jot .sm files. Many 3D model formats can be converted to obj.

A copy of the models directory is also available on CAEN for those who don't want to check out their own copies. The path is:

    /afs/engin.umich.edu/class/perm/eecs487/models/   [Linux etc]
   K:\perm\eecs487\models                           [Windows]

Handing in

Copy all your project files (no models) to 
    /afs/engin.umich.edu/class/f05/eecs487/submit/<your-uniqname>/p2/     [Linux users]
       K:\f05\eecs487\submit\<your-uniqname>\p2                                                    [Windows users]

For submission from a remote, non-CAEN machine you can scp or sftp your files to the respective paths on red.engin.umich.edu

Your files should include your modified p2.C, shaders.H and shaders.C, files containing your GLSL vertex and fragment shaders (including your implementation of toon shading, your own shader, and lighting.fp and lighting.vp), and a brief write-up in PDF format that discusses:
  1. anything about your implementation that is noteworthy, and
  2. feedback on this assignment, including suggestions for how it should be changed next time.
    Bottom line: typing make on the command line should compile without errors and link to the central JOT installation in

        /afs/engin.umich.edu/class/f05/eecs487/jot
                OR
     K:\f05\eecs487\jot

       
Modify your Makefile accordingly before submission!
        Test the compilation when you submit!



Multiple submissions:
  • You are allowed to overwrite your files in the above directory as many times as you want.
  • If the timestamp on these files is past the deadline your submission will be considered late.
  • Test this submission procedure and please let the GSI know well in advance if you encounter and problems.

Due date

The project is due on October 12, 2005, by 11:59pm. Turning it in 48 hours earlier is worth a 4% bonus; turning it in 24 hours early is worth a 2% bonus.


Last updated: 07 Oct 2005