There are two categories of shaders included with PhotoRealistic RenderMan. The first is the set of standard shaders required by the RenderMan Interface. The other is the set of example shaders included to illustrate various concepts of shader writing and use.
The four types of shaders are surface shaders, displacement shaders, light shaders, and volume shaders. For an explanation of these, see Steve Upstill's The RenderMan Companion: A Programmer's Guide to Realistic Computer Graphics (Reading: Addison-Wesley, 1990), pp. 170-180. Although the standard shaders include samples of all four types, there are no volume shaders with the examples.
The format used to document each of these shaders is borrowed from the standard UNIX man pages. Non-UNIX users may ignore the section designation 3s on all the pages -- they are there for historical reasons. The designation is a carry over from the UNIX convention of using Section 3 for the similar category of library functions and subroutines. The s is to help distinguish these shaders from the C functions found normally in Section 3, and in particular from the Standard I/O Functions in Section 3S.
The SYNOPSIS line of each shader's page lists the syntax that would be used to call the shader from a RIB file. A different syntax would be needed for a call in the RenderMan Interface. For example, the wood surface shader could be called with the following RIB line:
Surface "wood" "Ka" [0.6] "Ks" [0.5] "specularcolor" [1 1 1]
and with the equivalent line as written in the RenderMan Interface:
RiSurface(wood, "Ka", 0.6, "Ks", 0.5, "specularcolor", [1 1 1], RI_NULL);
The first word of the SYNOPSIS line will be the RIB command used to call the shader and will thus indicate whether the shader is a Surface, Displacement, Light, or a Volume shader.
The PARAMETERS part of each man page lists the default values for each of the parameters accepted by the shader. Only those parameters whose values you wish to change from the default need be specified in the shader call.
Most parameters are numbers (floats) whose range of valid values is determined by each individual shader. In RIB parameter lists, each number must be enclosed in square brackets.
Some parameters represent points in space and are given as an ordered triple of numbers, (three numbers separated by spaces and enclosed in square brackets). Point parameters are used by light shaders, for example, to determine the location of the light source in space or the direction it is pointing.
Still other parameters are colors. A color is an ordered triple with the numbers representing the red, green and blue components of the color (its RGB value). Although it is possible for a shader to use a different representation of color, (for example with more than three components), the shaders included here all expect an RGB triple.
Other parameters can be strings of characters enclosed in quotes. This is generally used to specify the name of a file to be used as a texture map by the shader.
Several parameters appear often enough in the standard shaders and example shaders to imply somewhat of a convention. These conventions are not mandatory, and in fact may not be followed by the all the shaders documented in the pages that follow, but it is useful to list some commonly used parameters here.
Surface shaders commonly use the following parameters:
Displacement shaders often use another kind of coefficient.
Light shaders commonly use some or all of the following parameters:
Volume shaders (atmosphere shaders) commonly use parameters that define spacial boundaries for the effect of the shader, and some background color that gets mixed in with object colors to obtain the effect.
Surface Examples:
Light Examples:
Displacement Examples:
Function Examples:
Chapter 16 of The RenderMan Companion discusses the standard shaders including a specification of the parameters of each shader.
Appendix A of the RenderMan Interface Specification gives a more up-to-date listing of the standard shaders.
Pixar Animation Studios
|