RenderMan shaders
These are the main things to know:
* written in RSL (a C-like language), compiled into .slo files
* geometry/material assignments
are made in the RIB file
* GIVEN: args through
an arg list and global vars ("state")
* COMPUTE: values for
other global vars, eg. Ci and Oi
* NO formal return values!
* args can have default
values
* #if, #define, #include
are allowed
* data types - float,
color, point, vector, normal, matrix, string
* '
uniform' vs. 'varying'
parameters
* RSL comes with a rich
set of prebuilt-function calls, and the user can write
custom functions for invocation.
RenderMan provides a set of 'global' variables
that carry information about the scene and shading. These variables are
useful inside a shader to provide access to those pieces of information.
For instance, 'P' stands for the position of the point currently being shaded.
Here are the main variables
available to you for use inside a shader:
P
N
I
E
s,t
L
Cl
Cs
Os
Ci
Oi
Types
of "shaders":
* surface
* displacement
* volume
* light
* imager
Surface shaders
* most common type
* ONE only, per surface
teapot.rib
shaderskel.sl
constant.sl
matte.sl
metal.sl
plastic.sl
tex.sl
,
Voderberg.tiff
rotblocks.sl
,
rmannotes.sl
TangramStork.rib
clouds.sl
funkyglass.sl
show_st.sl
UtahTeapot.rib
'Negative' lighting
Texmapping fun
Displacement shaders
* alter P, recalculate
the normal vector
* altering just N but not P is "bump-mapping"
Gumbo.rib
SurfRippleFn.sl
DispWaterford.sl
A sample result
Light shaders
* these cast light on
to surfaces and volumes
Gumbo.rib
TLblocker1spotlight.sl
,
Voderberg.tiff
Volume shaders
* NEED a background
(environment)
noisysmoke.rib
noisysmoke.sl
Resulting image
Imager shaders
* BMRT only
* Kat's site -
KTcanvasI.sl shader
Misc. topics
* PM vs. NPM
* analytical antialiasing
* faking volume fx using
surfaces
* lens flare