781 Lab3

 

CSE 781 lab3 (14 Points)

 

Due: March 3rd  (Wednesday) 11:59 pm.


Bump Mapping: In this lab, you will implement bump mapping using GLSL. The input to your program will be a 2D image, in any format, whose gradients (du,dv) are to modify the normals of your object.


Task: implement bump mapping  using the dot3 bump mapping algorithm discussed in class. A brief summary of the algorithm is described below: First, for every vertex, you construct a tangent vector (T)  and a normal vector (N), from which you compute the binormal (B) by a cross product of N and T. With these vectors, you can create a local tangent space to which the light and eye vectors will be transformed. The transformation is done in your vertex program. Your fragment program will receive the interpolated light vector and eye vector, and compute illumination using the modified normal from the normal map. Assuming the normal map stores 2D gradient vectors (du, dv), then the modified normal is (du,dv,1) – remember to normalize this vector before computing the lighting.


You will generate bump mapping for the following two types of object:

(1)(7 Pts)  A simple Quad

  1. (2)(7 pts)  A parametric torus - the equation of the parametric torus are: ..


  2. X = 3 * cos (u) + cos (v) * cos (u)

  3. Y = 3 * sin (u) + cos (v) * sin (u)

  4. Z = sin (v)


  5. where u and v range from 0 to 2 PI


  6. you can get the torus and some other parametric objects from this Flash web site:

      http://mathdl.maa.org/mathDL/3/?pa=content&sa=viewDocument&nodeId=1598&bodyId=1711


Lab submission


Submit your source code (.C and .h),  and/or Makefile (if you have any). Do not submit any executable files. Our TA will use some sample PLY models to test your program.


Submit a readme file specifying what are being submitted and how to compile and link your program.

Use the following command on stdsun to submit your lab3


> submit c781aa lab3 <names of all your files>


Notes about the submit program

The 'submit' program submits all of the files at once,  not  one at a time, previous submissions for a given lab are completely removed.  Or put another way; each time the  submit command is issued for a given lab, ALL of the previously submitted files are clobbered.

That means that

          > submit c781aa lab3 lab3.c

          > submit c781aa lab3 readme

will result in ONLY 'readme' remaining in the lab3 submission

You should do the following:

          > submit c781aa lab3 lab3.c lab3.h .... readme

          or

          > submit c781aa lab3 lab3_dir

Where 'lab1_dir' is a directory containing all of  the  lab3 files to be submitted, or best of all (for both student and grader) is:

          > cd lab3_dir

          > submit c7811aa lab3 .

 

Submit will immediately print submission information to  the submitter. Use 'man submit' if you have any other questions.

Late Penalty

You should submit your lab on time. We are on a quarter schedule, which is pretty tight. Being late for one lab could affect the time left for you to complete subsequent labs. All labs are due at 11:59 pm. of the specified due data, and there is a 10% penalty each day for up to 50%. After that, you get zero.

Grading Criteria

Grading of the labs will be based on the following:

    •    90%: Correctness and adherence to assignment specification.

    •    10%: Readability, structure of code, use of comments, adherence to lab procedures (submitting, naming conventions, etc.)

 

The grader will grade the labs. If you have problems with the grade you received on your lab, see the grader first. If you can't resolve the dispute with the grader, then see me. However, in order to maintain consistent grading for everyone in the class, I am not very inclined to alter grades that are assigned by the grader.

 

Don't copy labs. Discussion of lab assignments is allowed and encouraged. However, you need to complete the lab all by yourself. Labs which are too similar will be handed over to the Committee on Academic Misconduct and handled by them.

 

Last updated: 2/16/2010  Han-Wei Shen