PhotoRealistic RenderMan 3.6
Shading Language Extensions

Pixar
January, 1996

Several proprietary extensions have been made to the Shading Language in PhotoRealistic RenderMan 3.6, in order to facilitate writing more powerful systems of shaders. There are several new or enhanced built-in functions, two new variable types for vectors, better control of specular and diffuse lighting, a generalization of distant lights for environment mapping, and a new persistent data type which provides the basis of a "blackboard"-style message passing system.

1. Built-in Functions

The following new built-in functions have been added to the Shading Language:

float inversesqrt( float x )

float random( )
point random( )

point vtransform( string fromspace, tospace; point V )
point vtransform( string tospace; point V )
point ntransform( string fromspace, tospace; point N )
point ntransform( string tospace; point N )

color ctransform( string fromspace, tospace; color C )
color ctransform( string tospace; color C )

point rotate( point Q; float angle; point P0, P1 )

float filterstep( float edge, s1 [, s2]; [parameterlist] )

float cellnoise( float x )
float cellnoise( float s, float t )
float cellnoise( point pt )
float cellnoise( point pt, float t )
point cellnoise( float x )
point cellnoise( float s, float t )
point cellnoise( point pt )
point cellnoise( point pt, float t )
color cellnoise( float x )
color cellnoise( float s, float t )
color cellnoise( point pt )
color cellnoise( point pt, float t )

The following built-in Shading Language functions have been extended to add greater flexibility and to increase the overall efficiency of shaders which use them.

float min( float a, b, ... )
point min( point a, b, ... )
color min( color a, b, ... )
float max( float a, b, ... )
point max( point a, b, ... )
color max( color a, b, ... )
float clamp( float a, min, max )
point clamp( point a, min, max )
color clamp( color a, min, max )
float mix( float fg, bg; float value )
point mix( point fg, bg; float value )
color mix( color fg, bg; float value )

float spline( [string basis;] float value; float f1,f2,...,fn,fn1 )
color spline( [string basis;] float value; color f1,f2,...,fn,fn1 )
point spline( [string basis;] float value; point f1,f2,...,fn,fn1 )
float noise (point pt, float t)
color noise (point pt, float t)
point noise (point pt, float t)
float shadow ( ..., parameterlist )
float texture ( ..., parameterlist )
color texture ( ..., parameterlist )
color environment ( ..., parameterlist )