Lab 1

to learn about ray intersection and space partition techniques

Due: Monday, October 31, 2016 at 23:59

Start Early!!!

This lab was modeled after the exercise 4.1 and 4.2 of the pbrt book.
Individual Effort:
No team participation is really encouraged in the case of the homework or the labs.
Academic Misconduct
Late Submission:
In general late submission is not encouraged/accepted unless there is a very good reason. You are encouraged to submit on time. We are on a tight schedule. Being late for one lab could affect the time left for you to complete subsequent labs. Late Submissions are possible, yet they will be penalized.
  • One day late: 15% penalty
  • Two days late: 30% penalty
  • Three days late: 50% penalty
  • Four or more days late: 100% penalty.

Objectives

The goal of this assignment is two-fold. At first, you are to reason about the pros and cons of the ray-tracing acceleration structures that pbrt has implemented. In that part of the lab, you will get to know the scene description files of pbrt and do not have to modify the code at all. In the second part, however, you are to improve the grid acceleration structure of pbrt and evaluate how much performance improvements you get.


Step 1: Understand pbrt's implementations of the grid accelerator

It is critical that you first obtain a detailed understanding of pbrt's grid accelerator. Read Section 4.3 of the textbook and make sure you can follow the code in grid.cpp, located in the accelerators directory of the code base. Include the answers to the following questions about the current implementation in your writeup.

Step 2: Understand pbrt's implementations of the BVH accelerator

It is critical that you first obtain a detailed understanding of pbrt's BVH accelerator. Read Section 4.4 of the textbook and make sure you can follow the code in bvh.cpp, located in the accelerators directory of the code base. Include the answers to the following questions about the current implementation in your writeup.

Step 3: Background reading

Read the paper "Grid Creation Strategies for Efficient Ray Tracing" by Thiago Ize, Peter Shirley, and Steven Parker. Include the answers to the following questions in your writeup.

Step 4: Implement a two-level grid accelerator

Modify grid.cpp so that the grid accelerator uses a two-level grid using the heuristics as explained in the paper by Ize et al. Be sure to keep a copy of the original grid accelerator implementation around for use in later assignments and for debugging and test in this assignment. (Alternatively, you may want to implement your two-level grid accelerator as a new class in pbrt. This will require modification of the pbrt project/Makefiles, and some of the surrounding pbrt code, but would allow you to select between your and the original grid implementation by only changing the scene file, not recompiling the grid accelerator module. Mike showed how to do this.).

Debugging suggestions


Step 5: Evaluation

Understand the performance gains of your implementation.

building time

The rendering time reported by pbrt does not include the time spent building the acceleration structure. Use the ProgressReporter class to measure the amount of time it takes pbrt to create a grid (see the CreateGridAccelerator function in grid.cpp. Modify the code to time the creation of the GridAccel like this:

    ProgressReporter progress(1, "Building twoLevelGrid");

    GridAccel* accel = new GridAccel(prims, refineImmediately);
    
    progress.Update();
    progress.Done();

Step 6: Submission

Be sure to double check your final submission by unzipping it in another directory on a computer in the PC LAB and testing it. (Especially for last minute submissions.) A project that doesn't run will lose more points than one that is one day late. Be sure to submit any comments or remarks in a 'readme.txt' file. Submit your files at Moodle here. Your submission should contain:

We expect a good student to have to work approximately 15 hours on this assignment.

Grading

This assignment is extremely open ended, and there are many ways to correctly implement the assignment. In addition to the correctness of your code, your grade will depend largely on your ability to describe the strategies you tried and your evaluation of them on the test scene.

This assignment (as well as all future assignments in the class) will be graded on a 4 point scale:

NOTE: We will NOT (under any circumstance) accept labs that only run under windows or have porting problems. You are on your own, if you use windows to develop your labs. There will be absolutely NO exceptions.

Academic Honesty