FUNCTIONS



AMBIENT

Click box to see full description


This function returns a color.  OUT = CS*Ka*ambient()
The color is the sum of the contributions of all ambient light sources
multiplied by the co-efficient Ka and the surface color CS. 
refer to page 315 in the RenderMan Companion.

DIFFUSE

Click box to see full description


This function returns a color.
The color is the sum of the diffuse reflection for all light sources
multiplied by the co-efficient Kd and the surface color CS.
OUT = CS * Kd * diffuse(faceforward(normalize(NN),I)).
refer to page 316 in the RenderMan Companion.

SPECULAR

Click box to see full description


This function returns a color.
The color is the sum of the specular reflection for all light sources
multiplied by the co-efficient Ks and the highlight color HI.
OUT = HI * Ks * specular(faceforward(normalize(NN),II),normalize(-II),rgh).
refer to page 317 in the RenderMan Companion.

PHONG

Click box to see full description


This function returns a color.
The color is the sum of the contributions of all the light sources
on the surface multiplied by the co-efficient and the surface color.
OUT = CS * Kd * phong(faceforward(normalize(NN),II),II,exp).
refer to page 316 in the RenderMan Companion.

REFLECT

Click box to see full description


Returns a point which represents the direction of the reflected ray.
refer to page 328 in the RenderMan Companion.

REFRACT

Click box to see full description


Returns a point which represents the direction of the transmitted ray.
refer to page 328 in the RenderMan Companion.

FRESNEL

Click box to see full description


This function returns the fraction of reflected light Kr,
the fraction of refracted light Kt, the direction of the
refracted ray R and the direction of the transmitted ray T.

LUMINENCE

Click box to see full description


This is function takes a color C and returns the luminence value.
Luminence is calculated by averaging the components of the color.
The reutrn value is a float = (R + G + B)/3.

TEXTURE

Click box to see full description


This function returns the color and opacity, if any,
found in the texture map file MAP at location (S,T).
WS and WT may be used to enhance the filtering.
refer to pages 320-321 in the RenderMan Companion.

TEXTURE8

Click box to see full description


This function returns the color derived from
the area in the texture map file MAP defined by
the corners (S1,T1), (S2,T2), (S3,T3) and (S4,T4).
WS and WT may be used to enhance the filtering.
refer to pages 320-321 in the RenderMan Companion.

ENVIRONMENT

Click box to see full description


This function returns the color in 
the environment map MAP from the direction of R.
refer to page 323 in the RenderMan Companion.

ENVIRONMENT4

Click box to see full description


This function returns the color in the environment map MAP 
filtered from the region defined by direction vectors: P1, P2, P3, P4.
refer to page 323-324 in the RenderMan Companion.

SHADOW

Click box to see full description


This function returns a color.  SHD = C*Kr*shadow(MAP,PP);
It gives the extent the point PP is in shadow;
where 1 is completely shadowed and 0 is completely exposed.
This value multiplied by the co-efficient and the shadow color.
refer to page 322 in the RenderMan Companion.

SHADOW4

Click box to see full description


This function returns a color.  SHD = C*Kr*shadow(MAP,P1,P2,P3,P4);
It gives the extent the area defined by P1, P2, P3 and P4 is in shadow;
where 1 is completely shadowed and 0 is completely exposed.
This value multiplied by the co-efficient and the shadow color.
refer to page 324 in the RenderMan Companion.

AUTOMAP

Click box to see full description


This function uses the normal to the surface to do a planar projection.
The projection is performed with (UU,VV) equal to (0,0) at the point O.
UU runs along the vector specified by Y and VV runs along the vector 
perpendicular to both Y and the normal to the surface. For surfaces
which are perpendicular to Y, a reasonable guess at "up" is attempted.
N.B.: this only works well on faceted surfaces (polygonal or bilinear).

CYLINMAP

Click box to see full description


This function returns UU and VV, the coordinates for cylindrical mapping.
The central axis is along Z.
The point on the equator where (UU,VV) equals (0,0) is at the X axis.

PLANEMAP

Click box to see full description


This function returns UU and VV, the coordinates for orthogonal mapping.
The projection is performed as if the texture was placed with point O
representing (UU,VV) = (0,0) and UU running along X and VV running along Y.
The map is then projected parallel to itself onto the surface.

SPHEREMAP

Click box to see full description


This function returns UU and VV, the coordinates for spherical mapping.
The north pole is on Zaxis.
The point on the equator where UU equals 0 is mapped is at the X axis.

BIAS

Click box to see full description


Input X is raised to log(B)/log(0.5).

BILERP

Click box to see full description


This functon returns float which is a bilinear interpolation
between the four corners (S1,T1,S2,T2) in texture space 
to the given point (U,V) in parameter space.

ILLUMINATE

Click box to see full description


This function calls the illuminate function.
POS is the position of the light. 
DIR controls the direction of the light.
ANG controls the cone angle for the light.
LGT is the light color.
The closeit box must be used to finish the statement.
refer to page 306 in the RenderMan Companion.

SOLAR

Click box to see full description


This calls the solar function.
DIR controls the direction of the light.
ANG controls the cone angle for the light.
LGT is the lightcolor.
The closeit box must be used to finish the statement.
refer to page 306 in the RenderMan Companion.

CLOSEIT

Click box to see full description


This closes a light color construct.

PRINTF

Click box to see full description


This function is used to print out the value of variables.
The variable may be any data type.
refer to page 332 in the RenderMan Companion.

FORLOOP

Click box to see full description


This function generates a fractal variable.
NUM is the number of iterations through the loop.
INC is the increment for the loop counter.
FQ  is the frequency for the noise.
PP  is the seed to the noise function.
SCL is multiplied by the noise function on each iteration.
DIV is the divisor for SCL on each iteration.