Returns | Function | What |
---|---|---|
float | . | Dot product |
float | ^ | Cross product |
float,color,point,vector | + - * / | Component-wise arithmetic |
float | sin( r ) | sine of an anagle in radians |
float | asin( s ) | radian arc whose sine is s |
float | cos( r ) | cosine of an angle in radians |
float | acos( c ) | radian arc whose cosine is c |
float | tan( r ) | tangent of an angle in radians |
float | atan( t ) | radian arc whose tangent is t |
float | atan( y, x ) | radian arc whose tangent is y/x |
float | PI | 3.14159265... |
float | radians( d ) | Convert degrees to radians |
float | degrees( r ) | Convert radians to desgrees |
float | sqrt( v ) | Square root |
float | pow( x, y ) | x y |
float | exp( v ) | e v |
float | log( v ) | log ev |
float | mod( v, b ) | modulo( v, b ) |
float | abs( v ) | Absolute value |
float | sign( v ) | -1. or 1. depending on the sign of v |
float | min( a, b ) | Minimum |
float | max( a, b ) | Maximum |
float | clamp( v, min, max ) | Clamps to range [min,max] |
float | ceil( v ) | Smallest integer >= v |
float | floor( v ) | Largest integer <= v |
float | round( v ) | Closest integer to v |
float | step( m, v ) | 0. if v < m, 1. if v >= m |
float | smoothstep(min, max, val ) | 0. if v < min, 1. if v > max, else smooth interpolation from 0. to 1. |
color | mix( c0, c1, t ) | (1.-t)*c0 + t*c1 |
--- | printf( "string", v1, v2, ... ) | Print to the console window |
float | noise(p) | Perlin noise of a float or point |
float | xcomp(p) | X component of a point |
float | ycomp(p) | Y component of a point |
float | zcomp(p) | Z component of a point |
--- | setxcomp(p,v) | Set the X component of a point to v |
--- | setycomp(p,v) | Set the Y component of a point to v |
--- | setzcomp(p,v) | Set the Z component of a point to v |
float,color | texture( "name", s, t ) | Return a color or a float from a texture |
float | length(V) | Euclidean length of vector V |
float | distance( P1, P2 ) | Distance between 2 points |
float | area(P) | Returns the area covered by P, in pixels |
float | depth(P) | Returns normalized depth of P (near=0., far=1.) |
vector | calculatenormal(P) | Returns the new surface normal at P |
vector | normalize(V) | Returns unitized V |
vector | faceforward(V,I) | Return V flipped to point opposite I |
float | ambient() | Returns the sum of all ambient contributions |
float | diffuse(N) | Returns sum of all diffuse contributions to normal N |
float | specular( N, eye, roughness ) | Returns sum of all specular components to normal N and eye position eye |
vector | reflect( I, N ) | Returns the reflection vector of I around N |
vector | refract( I, N, eta ) | Returns the refraction vector of I through N with index of refraction eta |
There are two ways to think of a "coordinate system": (1) an origin location and an orientation, and (2) a transformation. Keep both of these in mind when thinking about the meaning of RenderMan coordinate spaces.
point newpt = point "spacename" oldpt;
point newpt = point "spacename" ( oldx, oldy, oldz );
where the possible spacenames are:
"object" | The coordinates in which an object is defines (=MC) |
"world" | The coordinates into which an object's points are transformed |
"current" | Default coordinate system (camera? world?) |
"camera" | The coordinate system with the eye at the origin looking in (LHS) +Z (=EC) |
"shader" | The world coordinate system that was active when a Surface shader was invoked |
The same global transformation is used for both the world transformation and the eye transformation. Transformations that happen before the WorldBegin are assumed to be eye transformations. Transformations that happen after the WorldBegin are assumed to be object transformations.
vector Nf = faceforward( normalize(N) ,I );
vector V = normalize( -I );
Oi = Os;
Ci = Os * ( Cs * ( Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular( Nf, V, roughness ) );