CS 348B - Computer Graphics: Image Synthesis Techniques

Homework 1 - Introduction to PBRT


Assigned Thursday, March 31.   Due Thursday, April 7


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 (so as to ease the grading process for the TA).

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 (with several bug fixes) here. The archives are also accessible at /usr/class/cs348b/WWW/restricted/pbrt.  But 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.

There are 30 public machines for your use in the Sweet Hall Graphics Labs, two rooms in the basement of Sweet Hall. The machines are named raptor1 - raptor15 and firebird1 - firebird15. Use ssh for remote access. Students in CS 348B have non-exclusive priority access to this laboratory, whose door is opened using your Stanford ID.  

Step 2: Render a test scene

Once you have successfully compiled pbrt, you should try rendering some images. The scenes directory (pbrt/scenes/) contains the scene file: sphere-over-plane.pbrt. 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 which system you use), the rendering will finish. You will have a new image, pbrt.exr, in your directory. Use the imageview (windows, linux, mac) binary to view the image, or convert it to a tiff using exrtotiff (windows, linux, mac).  These two utilities are also accessible at /usr/class/cs348b/WWW/restricted on leland. Congratulations! You've rendered your first image with pbrt. 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. The CD contains several other scene files. 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 the first 1-3 chapters 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?





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 (for instance, under the www directory of your leland account).  Include the following and no more, please:

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 cluster 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.  


Mail the URL for your web page to cs348b-spr0405-staff@lists.stanford.eduWhen submitting, please do not mail anything other than a URL.


Copyright © 2005 Pat Hanrahan