Shading a surface involves the following:
Prman does all this by the use of shaders. So we have light source shaders -- point, distant, spot lights, window lights, etc. There are surface shaders, volume shaders, etc. Prman provides a set of shaders but the user can write their own shader. A shader is a procedure called to compute a value or set of values needed during rendering. There may be multiple instances of a shader, e.g., several point light sources, each with different parameters.
There are several environment variables that can be associated with shaders, such as the following:
We can create a light source by:
We can have multiple instances of lights, each one creates a new light, The light is automatically "on" when created. We can turn it off/on by: RiIlluminate(light, onoff). Once defined a light source remains until the end of enclosing block (world or Frame).
There are some prdefined light sources as follows (in format name, parameterlist) (The default instnsities and colors are all 1.0):
A spotlight is more complex than the other light sources. The figure below shows the different parameters of the spotlight:

Similar to a pointlight, a spotlight has a position and a direction. The intensity falls off with angle such that the intensity = 1 in the direction of the spotlight (from--> to) and intensity = 0 at coneangle radians away. The fall off function F(ca) = F1 * F2, where F1= (L*A)^beamdistribution. A = from->to direction and L = light vector from surface point to spot light. So the larger the beamdistribution the faster the faster fall off. F2 = 1 from A to coneangle - conedeltaangle redians and has a smooth fall-off to 0 at coneangle radians.

Here is a set of four images that illustrate the different types of light sources:
Here is the RIB file that produced these images.
Surface shaders determine the color of light reflected from a surface. Generaly we use the incoming light and the surface properties. In general I reflected( )= I incident( ) * reflectivity( ). We usually only sample at 3 colors's (R,G,B) although could change by, RiColorSource (N,n RGB, RGBn) which sets RiColor to [N] rather than [3].
Predefined surface shaders boat reflected color as (ombient, deflse, & speuellor reflections) Ombient --> constant deffuse CI=CL * max( ,N*L) | | reflected light incident light Specular reflection --> CI = CL * (N*H) H=y2 way between L, I median view Surface shaders are are chosen by RiSurface(name, parameterlist). There are several standard surface shaders as follows:
For the above the specular intensity is given by (N*H) 1/roughness, i.e. roughness = 1/(Phong n value)
Volume shaders affect light passing through a volume. A special case is atmosphere shaders. There are two standard atmosphere shaders:
Go back to
previous screen
HyperGraph Table of Contents.
HyperGraph
Home page.