26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

step returns 0 if value is less than min; otherwise it returns 1. smoothstep returns 0<br />

if value is less than min, 1 if value is greater than or equal to max, and performs a<br />

smooth Hermite interpolation between 0 and 1 in the interval min to max.<br />

float filterstep ( float edge, s1; ...parameterlist...)<br />

float filterstep ( float edge, s1, s2; ...parameterlist...)<br />

This function provides an analytically antialiased step function. In its two argument<br />

form, it takes parameters identical to step, but returns a result which is filtered over<br />

the area of the surface element being shaded. If the optional s2 parameter is provided,<br />

the step function is filtered in the range between the two values. This lowpass<br />

filtering is similar to that done for texture maps (for reference, see Section 15.7,<br />

Texture Mapping Functions). <strong>The</strong> parameterlist provides control over the filter function,<br />

and may include the following parameters: ”width” (aka ”swidth”), the amount to<br />

“overfilter” is s; ”filter”, the name of the filter kernel to apply. <strong>The</strong> filter may be any<br />

of the following: ”box”, ”triangle”, ”catmull-rom”, or ”gaussian”. <strong>The</strong> default filter is<br />

”catmull-rom”.<br />

float spline ( [string basis;] float value; float f1, f2, ..., fn, fn1 )<br />

float spline ( [string basis;] float value; float fvals[] )<br />

color spline ( [string basis;] float value; color c1, c2, ..., cn, cn1 )<br />

color spline ( [string basis;] float value; color cvals[] )<br />

point spline ( [string basis;] float value; point p1, p2, ..., pn, pn1 )<br />

point spline ( [string basis;] float value; point pvals[] )<br />

vector spline ( [string basis;] float value; vector v1, v2, ..., vn, vn1 )<br />

vector spline ( [string basis;] float value; vector vvals[] )<br />

spline fits a spline to the control points given. At least four control points must always<br />

be given. If value equals 0, f2 (or c2, p2, v2) is returned; if value equals 1, fn (or cn,<br />

pn, vn) is returned. <strong>The</strong> type of the result depends on the type of the arguments.<br />

If the first argument to spline is a string, it is interpreted as the name of a cubic spline<br />

basis function. <strong>The</strong> basis may be any one of ”catmull-rom”, ”bezier”, ”bspline”, ”hermite”,<br />

or ”linear”. If the optional basis name is not supplied, ”catmull-rom” is assumed,<br />

resulting in the control points being interpolated by a Catmull-Rom spline. In the<br />

case of Bezier and Hermite spline bases, the number of spline knots must be 4n+3<br />

and 4n+2, respectively. In the case of linear spline basis, the first and last knot are<br />

unused, but are nonetheless required to maintain consistency with the cubic bases.<br />

For all spline types, an array of values may be used instead of a list of values to<br />

specify the control points of a spline.<br />

float Du ( float p ), Dv ( float p ), Deriv ( float num; float den )<br />

color Du ( color p ), Dv ( color p ), Deriv ( color num; float den )<br />

vector Du ( point p ), Dv ( point p ), Deriv ( point num; float den )<br />

vector Du ( vector p ), Dv ( vector p ), Deriv ( vector num; float den )<br />

<strong>The</strong>se functions compute the derivatives of their arguments. <strong>The</strong> type returned depends<br />

on the type of the first argument. Du and Dv compute the derivatives in the<br />

u and v directions, respectively. Deriv computes the derivative of the first argument<br />

with respect to the second argument.<br />

135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!