Assigned: April 4, 2000
Due: April 18, 2000
The purpose of this assignment is to add support for quadric surfaces
to lrt. You will need to support all of the quadrics listed
in the RenderMan
interface specification except for the torus (which, as we know
from lecture, is actually a quartic surface). For each of these
surfaces, you will have to provide code to compute the axis-aligned bounding box,
nearest intersection point, the surface normal, and texture
coordinates (u, v). Since lrt is implementing RenderMan, you
must adhere to the specification as listed on the RenderMan page.
To be explicit, your renderer should be able to produce correct
renderings of the following quadrics:
A useful test file, and the resulting image, with all the surfaces you are required to
implement, can be found here. You should
also try rendering this scene with different surface shaders and textures to verify
your normals and texture coordinates are correct for each primitive.
interface specification gives mathematical definitions for all of
the quadrics. Remember that your program needs to conform to the
standard set forth there.
Another useful tool for testing is BMRT.
BMRT is a RenderMan compliant shareware ray tracer that we've
installed for the SGI cluster in Sweet Hall. The output from your
renderer should match BMRT's output for the same input file.
Now that you know what you are going to be doing, we'll get you setup
with all the tools you'll need for this assignment.
We've provided a Makefile that will build the default
installation on the SGI machines. The code should be portable to
other platforms, but we're only supporting SGI for this class. We
will be doing all our grading on the SGI's as well, so make sure your
code works on the SGI's before turning it in.
- Copy /usr/class/cs348b/software/lrt/lrt.tar.gz to the
directory you'd like to install lrt into.
- Type gunzip lrt.tar.gz in the directory with
lrt.tar.gz. The result is a file named lrt.tar.
- Type tar -xvf lrt.tar. This will extract all the files
you need into a directory called lrt
- Fill in the code for quadrics.cc. You won't need to touch any
other files to implement all the quadrics correctly.
Once you've set up lrt and BMRT, you should be ready to do
- If you haven't done so already, add /usr/class/cs348b/bin
to your path (usually in your .cshrc file). This will give you access
to all the executables we have for the class.
- Add the SHADERS environment variable to your shell. BMRT needs to
know where to look for the shaders it needs. You can do this by
adding the line:
setenv SHADERS .:/usr/class/cs348b/software/BMRT2.5/shaders
to your .cshrc file. This tells BMRT to look in the current
directory, as well as the cs348b install directory for the surface shader
You run BMRT by typing rendrib -d ribfile. BMRT
output is a good guideline to what your ray tracer should output for
the same rib file.
Turn in your finished homework using the cs348b submit script:
Make sure you hand in all your source code, a Makefile, and a README
file. The README should contain instructions for compiling and
running your code, and a description of anything non-intuitive you've
done. Please do not submit any executables or object (.o) files. We'll
be building your submissions ourselves, and those just take up space.
This homework, and all subsequent programming assignments, will be
graded according to the following system:
0 - Little or no work was done
Full credit on this assignment means your program properly renders our
test files. Extra credit is truly extra credit. Extra credit
is not curved. Extra credit is for
people that really want to impress us. To earn extra credit on this
assignment, you should implement one of the following:
* - Significant effort was put into the assignment, but not everything
** - The assignment was completed satisfactorially; it passed all of
*** - Extra credit was completed.
If you do extra credit, be sure to write about it in the README.
Also, turn in any extra data files that you used.
- Implement an efficient scheme for ray tracing height fields. The
system should be capable of rendering 1K x 1K height images.
efficiently. Hint: Read Musgrave et al. on ray tracing height fields.
- Implement a general ray-implicit surface intersector. Hint: Read
Don Mitchell's paper on ray-surface intersection using interval arithmetic.
- Implement RenderMan subdivision surfaces. Design and implement a
ray-subdivision surface algorithm.
Get started early. Some of the corner cases are tricky. Also, the
lrt software is new this year. There may still be
undiscovered bugs. If a bug is found, it should be reported to
Bugs will be fixed as soon as possible, but don't expect us to be able
to fix any bugs that are found immediately. We have implemented the main part of this
assignment, so any bugs that may exist are only likely to be found
when you do the extra credit.
Copyright © 2000 Pat Hanrahan