CS 551/645: Introduction to Computer Graphics

Assignment #4

Goal: RenderMan / Blue Moon Rendering Toolkit (BMRT)

URL: http://www.cs.virginia.edu/~gfx/Courses/2000/intro.fall00.html/Assignments/assign4.html

Assigned: Tuesday, November 21, 2000

Due: Tuesday, Dec 5, 2000 at 9:00 a.m.

Relevant reading/files/software:


Synopsis:

For this assignment you will be using a ShareWare implementation of the RenderMan standard called BMRT (Blue Moon Rendering Tools). This toolkit is available on Suns, SGI's, Win95/98/NT, HP's, and Linux.

You will take a skeleton program named writerib.C and the corresponding Makefile and use them to produce the RIB files that can be rendered with rendrib. You'll also need the teapot.patches model. If you are working on the SGI's in Small Hall, you don't have to download your own version of BMRT because you can use what I have downloaded at: /h1/d/dc/dcb8j/Gfx/BMRT2.5.

In the previous assignments you were concerned with modeling objects in the scenes. This assignment will be concerned with rendering and shading models that are already provided for you. The first thing you must do however is fill in the code for the routine: RiLookAt(), which takes the same arguments as the corresponding routine in OpenGL: gluLookAt(). You will then be required to write different shaders for this scene. The shaders you have to write are:

The program that generates the RIB file should include the specifications for the camera location, lights, shaders, and environment map. Two of the light source shaders are provided for you in the example, but I would like for you to set the parameters such that good lighting results, note I also want you to generate shadows from each of the light sources.

The texture maps for the pedestal will be generated procedurally, and methods for this will be discussed in class. The environment map should be a cube map, and I would like you to reuse the images you used in assignment 3. The texture-maps must be in TIFF format however and not SGI format. The function imgcopy will perform the conversion for you. Also, a program called xv can be used for a number of image viewing and manipulation tasks.


Hints:

Rendering with this toolkit can take a long time for each image. I strongly suggest that you use the rgl program to preview your RIB files before rendering them with rendrib (especially when you are trying to get the camera transformations to work). Keep your test images small at first, say around 100x100 pixels. Also keep your texturemap images small, the larger they are the longer it takes. A good maximum size for a texturemap will probably be 640x480 pixels.

Here are some examples from a previous class's work.

NOTE: RenderMan is a left-hand system, but I want things to be done in a right-hand world. Also the shader compiler is called slc, and you must remember to recompile your shaders each time you make changes to them before rendering your images.


Additions:

You have to set the SHADERS environment variable so BMRT can find the shaders you want to use (including the default shaders):

If you use a shell that accepts export (e.g., bash),

export SHADERS=.:/home/dcb8j/Gfx/BMRT2.5/shaders
otherwise use
setenv SHADERS .:/home/dcb8j/Gfx/BMRT2.5/shaders

The . guarantees that it takes shaders from whatever directory you run the renderer in. If you put your shaders in some other directory, you will have to adjust SHADERS to include that path as well.

NOTE: the first uses '=', the second does not.

NOTE: teapot.tiff is what the image should look like given the camera parameters that I specified in the skeleton.


Grade Breakdown:

Here is the grade distribution for program #3.
  1. writerib.c compiles and runs (no coredump) 25
  2. View transform code works 15
  3. RIB file is correct (runs under rendrib) 10
  4. Light sources work (all 3) 10
  5. Shadows work 10
  6. Wood shader works 5
  7. Marble shader works 5
  8. Environment map works 10
  9. Scene composition (lit well/looks good) 5
  10. Comments and style 5
  11. Best one in class gets 7 extra points

Turning in the assignment:



Collaboration:

You may talk with one another about your projects, but one should not take written records during the collaboration. Your recollection of the concepts should be the product of the collaboration. Similarly, no side-by-side coding.

Use of the web

You may use the web to find additional information about Renderman, BMRT, and you may use shaders that you find on the web.