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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A PatchMesh primitive variable of class vertex has the same number of entries as the<br />

position ”P” (i.e., nu×nv) and is interpolated using the same order and basis matrices.<br />

Any varying primitive variables are interpolated piecewise-bilinearly across the patch<br />

mesh and contain n values, one for each patch corner, where n is defined by:<br />

uwrap vwrap<br />

n = (nupatches + 1) · nvpatches ”nonperiodic” ”periodic”<br />

n = (nupatches + 1) · (nvpatches + 1) ”nonperiodic” ”nonperiodic”<br />

n = nupatches · (nvpatches + 1) ”periodic” ”nonperiodic”<br />

n = nupatches · nvpatches ”periodic” ”periodic”<br />

(with nupatches and nvpatches defined as given above). If a variable is uniform, it<br />

contains nupatches × nvpatches elements of its type, one for each patch (see Figure 5.2).<br />

Primitive variables of class constant have exactly one data element of the appropriate<br />

type.<br />

A patch mesh is parameterized by a (u,v) which goes from 0 to 1 for the entire mesh.<br />

Texture maps that are assigned to meshes that wrap should also wrap so that filtering<br />

at the seams can be done correctly (see the section on Texture Map Utilities). If texture<br />

coordinates are inherited from the graphics state, they correspond to the corners of<br />

the mesh.<br />

Height fields can be specified by giving just a z coordinate at each vertex (using ”Pz”);<br />

the x and y coordinates are set equal to the parametric surface parameters. Height<br />

fields cannot be periodic.<br />

RIB BINDING<br />

PatchMesh type nu uwrap nv vwrap ...parameterlist...<br />

EXAMPLE<br />

RtPoint pts[28];<br />

RtFloat foos[2];<br />

RtFloat bars[6];<br />

RiBasis (RiBezierBasis, 3, RiBezierBasis, 3);<br />

RiDeclare (”foo”, ”uniform float”);<br />

RiDeclare (”bar”, ”varying float”);<br />

RiPatchMesh (”bicubic”, 7, ”nonperiodic”, 4, ”nonperiodic”,<br />

”P”, (RtPointer)pts, ”foo”, (RtPointer)foos,<br />

”bar”, (RtPointer)bars, RI NULL);<br />

SEE ALSO<br />

RiBasis, RiNuPatch, RiPatch<br />

Non-uniform B-spline patches are also supported by the <strong>RenderMan</strong> <strong>Interface</strong>. Rational<br />

quadratic B-splines provide exact representations of many different surfaces including general<br />

quadrics, tori, surfaces of revolution, tabulated cylinders, and ruled surfaces.<br />

71

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

Saved successfully!

Ooh no, something went wrong!