CSE 681 Lab3

 

Assigned: February 15, 2012

Due: February 27, 2012 11:59 PM

Lab overview: Enhance your ray tracer from Lab2 to include refraction, pixel supersampling, ray-box intersection, soft shadow, and depth-of-field.

Objective: Upon finishing this lab, you will learn how to add stochastic rays to your ray tracer to implement additional effects.

Tasks:

  1. 1.Refraction. Use 1.5 as the refractive index of transparent spheres. There are a few data files, refration1.iv, refraction2.iv, refraction3.iv in the data directory that you can use. Some more information about refraction can be found in the lab3 help  page.

  2. 2.Ray Box Intersection: include boxes in your scenes using SoCube. There are a few data files, cubesphere.iv, cubesphere{2-5}.iv in the data directory that you can use. Inventor Cube objects can have different length, width, and height. You can assume there is no rotation so the box(es) will be axis aligned. This way, you can use the algorithm discussed in class to perform ray-box intersection tests in world space.

  3. 3.Soft shadows: Shoot shadow rays to a randomized, but limited area around point light sources to simulate area lights and compute soft shadows. Define the area as a quadrilateral or a sphere centered at the light location. Experiment with different areas and numbers of rays to get good images.

  4. 4.Depth of field: Jitter the camera positions as we described in class to create the depth of field effect. Experiment with different focal lengths so that you are able to create the best results.

With the new features, your ray tracer command line will become

   rt  <input.iv> <output.ppm> <xres> <yres> <supersample_flag> <shadow_flag> <refraction_on> <depth_of_field_on>

   The value of supersample_flag - 0: no supersample; 1: supersample on

   The value of shadow_flag -  0: no shadow; 1: hard shadow;  2: software shadow

   The value of reflection_flag -  0: no reflection;  1: regular reflection;

   The value of refraction_on - 0: refraction off;  1: include refraction

   The value of depth_of_field_on:  0: no depth of field;  value other than 0 will be taken as the focal length. In your readme file, you need to tell us what value to use as the focal length for each of the data files.

Lab submission

Submit your source code (.C and .h) and Makefile. Do not submit any executable files. Our grader will use the sample .iv files in the Data director of the sample_read_iv folder to test your program. If you have some nicer scene files that you want the grader to use, you can submit them too.

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 c681aa 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 c681aa lab3 lab3.c
          > submit c681aa lab3 readme

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

You should do the following:

          > submit c681aa lab3 lab3.c lab3.h .... readme
          or
          > submit c681aa 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 c681aa 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:59pm 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/13/2012 Han-Wei Shen