CMSC 491G/691G: Real-Time Shading
Assignment 1
RenderMan
Due February 17, 2005
The Assignment
Use a RenderMan renderer to create and render a scene. Your scene should demonstrate three shading language features/approaches:
- Displacement, Surface and Light shaders
- The use of illuminance rather than the built-in diffuse and specular to compute a more interesting lighting model.
- Two-pass shading, with one pass generating some intermediate result into a texture and the second pass using that texture.
Each of these will give you some experience with shading techniques that will cross over into your later real-time shaders. Some notes:
- Displacement: To avoid cracking, you may need to set the displacementbound attribute to say how big your displacements might be.
- "Interesting Lighting Model": see Chapter 2 in the book (or find one in a more recent paper). Note that the book presents the BRDF for each lighting model. To sum the lighting in RenderMan, you'll need to multiply the BRDF by N•L (N.L in RenderMan; written <n,l> in the book).
- Two-pass shading: You can add extra arbitrary output variables to any rendering with RiDisplay("+image.tif","file","var-name",RI_NULL). Also, look at RiQuantize() for saving float textures or mapping arbitrary values into the fixed color range. Use it for non-local effects:
- Record an object ID and look up several nearby texels to create halos around objects that affect the shading of other objects
- Record position to find crevices or flat surfaces in the scene for dust distribution
- Unwrap an object into its texture space using a displacement shader and use the results for a model of translucent surfaces
- ...
Running RenderMan
You may use any RenderMan compliant renderer for your work. DotC Software (makers of one of the oldest RenderMan renderers) has a nice list of links to most of the RenderMan-compliant renderers that have ever been created. If you want to download your own, this is a good place to start. I have had good experience with 3Delight, which is available for free download for Windows, Linux and Mac.
Rather than download your own, you can instead use the copy of 3Delight in my 435-class directory on linux.gl.umbc.edu. To set up 3Delight for use, csh or tcsh users must
unsetenv DELIGHT
source ~olano/public/435/3delight/.3delight_csh (ignore ldconfig messages if you see them)
bash or sh users would instead use
unset DELIGHT
. ~olano/public/435/3delight/.3delight_bash
On Linux, your development cycle will go something like this:
repeat
edit .c & .sl files
make
display image (full path == /usr/local/bin/display)
until done
There are sample files checked into your assignment 1 CVS directory (see below) directory
Using RenderMan
Larry Gritz' RenderMan for Poets has a brief introduction to RenderMan C coding, Steve May's RManNotes is a nice guide to writing shaders. There's more information on both in the RenderMan specification. The User's Manual for your RenderMan renderer will give you information on how to compile your RenderMan C code and shaders, and how to render (for example the 3Delight User's Manual).
What (and how) to turn in what you do
I have created a CVS repository for each of you on the linux.gl systems at /afs/umbc.edu/users/o/l/olano/pub/cs691/your_username. I have some directions for checking out a copy of this repository and checking in your code. We are using CVS to submit assignments, but it is really a revision control system. Use it! Check in to CVS often. If you break something or accidentally lose files, you can always go back to a previous revision. Make sure your final version is checked in to your Assn1 CVS directory by 11:59 PM on the day of the deadline. You should include everything I'd need to render your project: all .c and .sl files, and any textures not generated by your shader. Also include an image of your final results (but not all of the intermediate .o's, executables, or other generated files). Also, include a readme.txt file telling me about your assignment. What did you do to satisfy the assignment requirements? What should I notice? What (if any) help did you receive from books, web sites or people?