The RenderMan Interface - Paul Bourke
The RenderMan Interface - Paul Bourke
The RenderMan Interface - Paul Bourke
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Quadrics, patches and patch meshes, and NURBS primitives have well-defined global twodimensional<br />
surface parameters. All the points on the surface of each primitive are functions<br />
of these parameters (u,v). Except for NURBS and polygons, the domain of the surface<br />
parameters is the unit square from 0 to 1. Texture coordinates may be attached to primitives<br />
by assigning four sets of texture coordinates, one set to each corner of this unit square.<br />
This is done by setting the current set of texture coordinates or by defining texture coordinates<br />
with the geometric primitives as described below.<br />
Subdivision surfaces and implicit surfaces have locally defined parameterizations, but no<br />
globally consistent parameterization across an arbitrary surface of that type.<br />
All geometric primitives normally inherit their color and opacity from the graphics state.<br />
However, explicit colors and opacities can be provided when defining the primitive (”Cs”<br />
and ”Os”).<br />
Associated with each geometric primitive definition are additional primitive variables that<br />
are passed to their shaders. <strong>The</strong>se variables may define quantities that are constant over<br />
the surface (class constant), piecewise-constant but with separate values per subprimitive<br />
(class uniform), bilinearly interpolated (class varying), or fully interpolated (class vertex).<br />
If the primitive variable is uniform, there is one value per surface facet. If the primitive<br />
variable is varying, there are four values per surface facet, one for each corner of the unit<br />
square in parameter space (except polygons, which are a special case). On parametric<br />
primitives (quadrics and patches), varying primitive variables are bilinearly interpolated<br />
across the surface of the primitive. Colors, opacities, and shading normals are all examples<br />
of varying primitive variables.<br />
<strong>The</strong> standard predefined primitive variables are defined in Table 5.1 Standard Geometric<br />
Primitive Variables. Other primitive variables may be predefined by specific implementations<br />
or defined by the user with the RiDeclare function, or may be declared “in-line” as<br />
part of the parameter name itself (see Section 3). Primitive variables which are declared<br />
to be of type point (including the three predefined position variables), vector, normal, or<br />
matrix are specified in object space, and will be transformed by the current transformation<br />
matrix. Any vector or normal variables will be transformed by the equivalent transformation<br />
matrix for vectors or normals. Primitive variables which are declared to be of type<br />
color must contain the correct number of floating point values as defined in RiColorSamples.<br />
More information about how to use primitive variables is contained in Part II: <strong>The</strong><br />
<strong>RenderMan</strong> Shading Language.<br />
5.1 Polygons<br />
<strong>The</strong> <strong>RenderMan</strong> <strong>Interface</strong> supports two basic types of polygons: a convex polygon and a<br />
general concave polygon with holes. In both cases the polygon must be planar. Collections<br />
of polygons can be passed by giving a list of points and an array that indexes these points.<br />
<strong>The</strong> geometric normal of the polygon is computed by computing the normal of the plane<br />
containing the polygon (unless it is explicitly specified). If the current orientation is lefthanded,<br />
then a polygon whose vertices were specified in clockwise order (from the point<br />
of view of the camera) will be a front-facing polygon (that is, will have a normal vector<br />
which points toward the camera). If the current orientation is right-handed, then polygons<br />
63