CS 395T

Advanced Image Synthesis

Spring 2006

Homework 1 - Introduction to PBRT

Assigned Wednesday, January 18. Due Wednesday, January 25

This assignment is designed to get you acquainted with pbrt, the physically-based rendering system you will use throughout this course. Your goal should be to get comfortable with the software by rendering several test scenes and reading the beginning chapters of the text book. pbrt has been developed and tested extensively on Linux, MacOS, and Windows. Feel free to use whatever platform you desire, however your assignment code should be portable, since I will be grading it assuming it runs on our standard Linux platform in the public labs.

Step 1: Install pbrt

All students should have a personal copy of pbrt, which comes with the text for this class. However, you should download the latest version, in which a number of bugs have been fixed, here. Please do not distribute this software. General install instructions (from the CD) provide information about configuring and running pbrt on different platforms. Note that if you are using windows there is a VS2003 solution in the win32 directory.

You may also use the public Linux machines in either Taylor Hall or in Painter Hall. The new version of pbrt is installed there in the directory /p/src/pbrt-1.02/. To use it, you should set the following:

PBRT_SEARCHPATH=/p/bin/pbrt
PATH=${PATH}:$PBRT_SEARCHPATH

or the equivalent (depending on your shell). /p/bin/pbrt not only contains the pbrt executable, but all the plugins and all the exr tool executables that come with the pbrt distribution. Note that this installation includes most of the new plugins described at pbrt.org. In addition to the source to the newest pbrt version, you will also find the test scenes and images from the cd in the /p/src/pbrt-1.02 directory. Finally, this installation was built and tested on the ship machines. There are a number of variant linux boxes in the labs. This installation will obviously only support x86 based machines, and may have problems on some of those. If you experience problems, report them to me at fussell@cs.utexas.edu.

Step 2: Render a test scene

Once you have successfully compiled pbrt, you should try rendering some images. The scenes directory (pbrt/scenes/ on the CD, /p/src/pbrt-1.02/scenes on the department machines) contains the scene file: spheres-over-plane.pbrt. If you are using the lab machines, make yourself a local scenes directory, and copy spheres-over-plane.pbrt into it. From inside the scenes directory type:

pbrt spheres-over-plane.pbrt

You will see some messages from pbrt. After a minute or so (depending on your system), the rendering will finish. You will have a new image, pbrt.exr, in your directory. Convert it to a tiff using exrtotiff (windows, linux, mac), which is installed along with pbrt in /p/bin/pbrt on the lab machines. You can then use any of a number of popular image viewers (e.g. xv on unix, Irfanview on windows...) to view the file (and in some cases convert it to a more popular/compact format like jpeg or png, which will come in handy for making web pages (see below)).You should see something that looks like this.

Step 3

Open the sphere-over-plane.pbrt scene file in a text editor. You will see a perspective Camera description followed by a Film type. Try reducing the resolution to half the current size. Also, try reducing the Sampler pixelsamples count from 2 to 1, and render the scene again. It will be smaller and have some jaggies, but it will render much faster. This will be useful later in the course; you'll want to do lots of quick and dirty renders for debugging.

Next in sphere-over-plane.pbrt you will find the description of the scene. You should be able to figure out the meaning of the lines that describe the area light source and the sphere shapes. Experiment with changing the colors of materials and lights. Try to build some intuition for how the transformations affect the final image. There are a number of other scene files in the scenes directory. Feel free to experiment with more complex scenes.

You can find detailed information about the pbrt scene description file format in appendix B of the text book.

Step 4: Readings from the pbrt textbook

Read chapters 1-3 of the pbrt book. Answer the following questions (one word or one line answers suffice):

  1. What physical quantity do we measure along a ray?
  2. What pbrt class is used to describe the reflection of light at a point?
  3. How are vectors and normals treated differently?
  4. What's the difference between 'Intersect' and 'IntersectP'?
  5. The ray direction is stored in the variable d in the ray class. What is the length of d?
  6. The ray class has mutable variables mint and maxt. Why are these variables mutable?
  7. Why is mint not initialized to 0 when a ray is created?
  8. How is the information about intersection between a ray and a shape represented in pbrt?
  9. What kind of coordinates are used to parameterize a triangle?
  10. The transform class has a reference to matrix. Why are matrices referenced and not stored in the transform class?

FAQ

Submission

In all the homeworks for this class we will evaluate your work by browsing web page write-ups. Create a "Homework 1" web page somewhere within your cs account (or approved alternative). Email me at fussell@cs.utexas.edu and tell me the URL you are using.

On the page, include the following (and no more):

  1. Create a sphere image rendered at 1 sample per pixel, and include it in your web page. You may want to use ImageMagick, a very useful utility installed on the public linux machines (same caveats as pbrt re ship machines), and which you can download for Windows as well, to convert your image to a format that can be included in a web page.
  2. The answers to the pbrt review questions from step 3.

For later assignments which involve coding and/or new scene files, you will also need to turn those in to me. Arrangements for that will be made at the time of these assignments.