- C:\Program
Files\Pixar\RenderManProServer-12.5.1 is the root of the Pixar
distribution.
- C:\Program
Files\Pixar\RenderManProServer-12.5.1\bin contains all of the
executables that you will need. You should assure that this
directory is in your PATH.
- Documentation for the Pixar tools can be found at C:\Program
Files\Pixar\docs-6.0.
Testing prman
To assure that
your can actually compile and run a shader, please download lab1.zip and extract in the
public directory on the ICL6 machines. You probably will
recognize these files as these were the files for the RenderMan
assignment in CG2. After extracting, try executing the following
commands in a command window.
shader *.sl
prman
ritwindow.rib
The shader
command is the shader language compiler and will compile the shaders
needed for the scene. The prman command will perform rendering of
a scene that uses the shaders compiled in the first step. You may
wish to take a look at ritwindow.rib
to see a description of the scene. If all is well, you should see
an image that looks like this:
Once you are
convinced that the programming environment is set up correctly, go into
the RIB file and experiment by modifying some of the parameters passed
to the shaders. You submission for this section should be
the result of these modifciations as well as the modified RIB
file. Please indicate in your README, what parameters were
modified.
B: Cg
Cg shaders get
compiled as part of development of a graphics application using DirectX
or OpenGL. In our labs, we will be using OpenGL as the basic 3D
API. The location of Cg on our machines is:
- The root of the Cg distribution can be found at C:\Program
Files\NVIDIA Corporation\Cg
- Cg executables are found in C:\Program
Files\NVIDIA Corporation\Cg\bin
- Cg libraries are found in C:\Program
Files\NVIDIA Corporation\Cg\lib
- Cg include files are found in C:\Program
Files\NVIDIA Corporation\Cg\include
- Cg documentation (for both the shader language and the Cg runtime
system) are found in C:\Program
Files\NVIDIA Corporation\Cg\doc
To test out the
Cg path, I will ask you to copy the examples folder C:\Program
Files\NVIDIA Corporation\Cg\examples to the C:\public
folder and to build and run the example in the folder runtime_ogl. You may find yourself
having to modify the properties of the Visual Studio project to point
to the proper include and library directories. Once you
are convinced that all is set up correctly, modify some of the
parameters (You may wish to look at the drawCube()
function) and submit the results of the modification.
Part 2 -
Intermediate
Time to write
your first shader from scratch. For this part, you are to
write an extremely simple shader, oneColor,
that colors a surface a single color. The color to draw
should be passed in as an argument to the shader.
For RenderMan,
please modify the RIB file used in Part 1. Change the shader on
the back wall from wood2, to oneColor.
For Cg, you can
start with the OpenGL / GLUT application demo2.c.
Note the
commented lines in the function colorcube.
For both
RenderMan and Cg, please submit the shader code and the image produced
by the shader.
Part 3 - Advanced
For the advanced
shader, I will ask you to modify your oneColor
shader to create a new shader named target
which will color all points on a surface within a given neighborhood
one color, and all points outside the neighborhood another color.
The target shader should have the following parameters:
- baseColor -- The color to be output for points outside the
neighborhood.
- targetColor -- The color to be output for points inside the
neighborhood.
- center -- The center of the neighborhood
- range -- The size of the neighborhood (all points with distance
from the center within range will be the target color).
Please take
special note of coordinate systems. i.e. assure that the points
whose distance you are comparing to range are both in the same
coordinate system. Note that both Cg and RenderMan have a
function that calculates the distance between two points, and both have
a means to transform points from one coordinate system to another if
needed. Please refer to the documentation to find these
functions.
Once again, for Renderman, apply the new shader on the back wall.
For Cg, feel free to use the colorcube example found in
demo2.c.
For both
RenderMan and Cg, please submit the shader code and the image produced
by the shader.
last updated: 03/22/06