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.
Information Name Type Class Floats<br />
Position ”P” point vertex 3<br />
”Pz” float vertex 1<br />
”Pw” h vertex 4<br />
Normal ”N” normal varying 3<br />
Color ”Cs” color varying (3)<br />
Opacity ”Os” color varying (3)<br />
Texture Coordinates ”s” float varying 1<br />
”t” float varying 1<br />
”st” 2 float varying 2<br />
Table 5.1: Standard Geometric Primitive Variables<br />
whose vertices were specified in counterclockwise order will be front-facing. <strong>The</strong> shading<br />
normal is set to the geometric normal unless it is explicitly specified at the vertices.<br />
<strong>The</strong> surface parameters of a polygon are its (x,y) coordinates. This is because the height z<br />
of a plane is naturally parameterized by its (x,y) coordinates, unless it is vertical. Texture<br />
coordinates are set equal to the surface parameters unless texture coordinates are given<br />
explicitly, one set per vertex. Polygons do not inherit texture coordinates from the graphics<br />
state.<br />
<strong>The</strong> rules for primitive variable interpolation and texture coordinates are different for polygons<br />
than for all other geometric primitives. Constant primitive variables are supplied as<br />
a single value for the entire aggregate primitive. Uniform primitive variables are supplied<br />
for each polygon. Both varying and vertex primitive variables are supplied for each polygon<br />
vertex, and are interpolated across the interior without regard to the artificial surface<br />
parameters defined above. Note that interpolating values across polygons is inherently<br />
ill-defined. However, linearly interpolating values across a triangle is always well defined.<br />
Thus, for the purposes of interpolation, polygons are always decomposed into triangles.<br />
However, the details of how this decomposition is done is implementation-dependent and<br />
may depend on the view.<br />
RiPolygon ( RtInt nvertices, ...parameterlist...)<br />
nvertices is the number of vertices in a single closed planar convex polygon. parameterlist<br />
is a list of token-array pairs where each token is one of the standard geometric primitive<br />
variables or a variable which has been defined with RiDeclare. <strong>The</strong> parameter<br />
list must include at least position (”P”) information. If a primitive variable is of class<br />
vertex or varying, the array contains nvertices elements of the type corresponding<br />
to the token. If the variable is uniform or constant, the array contains a single element.<br />
<strong>The</strong> number of floats associated with each type is given in Table 5.1, Standard<br />
Geometric Primitive Variables.<br />
No checking is done by the <strong>RenderMan</strong> <strong>Interface</strong> to ensure that polygons are planar,<br />
convex and nondegenerate. <strong>The</strong> rendering program will attempt to render invalid<br />
polygons but the results are unpredictable.<br />
64