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.

Section 10<br />

RELATIONSHIP TO THE RENDERMAN INTERFACE<br />

<strong>The</strong> Shading Language is designed to be used with the <strong>RenderMan</strong> <strong>Interface</strong> described<br />

in Part I of this document. This interface is used by modeling systems to describe scenes<br />

to a rendering system. Like most graphics systems, the <strong>RenderMan</strong> <strong>Interface</strong> maintains a<br />

current graphics state. This state contains all the information needed to render a geometric<br />

primitive.<br />

<strong>The</strong> graphics state contains a set of attributes that are attached to the surface of each geometric<br />

primitive. <strong>The</strong>se shading attributes include the current color (set with RiColor and<br />

referred to as Cs) and current opacity (set with RiOpacity and referred to as Os). <strong>The</strong> geometric<br />

primitive also contains a current surface shader (RiSurface) and several volume<br />

shaders: the current atmosphere shader (RiAtmosphere), current interior shader (RiInterior)<br />

and a current exterior shader (RiExterior). All geometric primitives use the current surface<br />

shader for computing the surface shading at their surfaces. Light directed toward the<br />

viewer is attenuated with the current atmosphere shader. If the surface shader of a primitive<br />

causes rays to be traced (with the trace() function), the ray color will be attenuated<br />

with either the current exterior shader or current interior shader, depending on whether the<br />

traced ray is in the direction of, or opposite to, the surface normal.<br />

<strong>The</strong> graphics state also contains a current list of light sources that contains the light sources<br />

that illuminate the geometric primitives. Light sources may be added to or removed from<br />

this list using RiIlluminate. Light sources can be attached to geometric primitives to define<br />

area light sources (RiAreaLightSource) or procedurally define their geometric properties<br />

(RiLightSource). <strong>The</strong> current area light source contains a list of geometric primitives that<br />

define its geometry. Defining a geometric primitive adds that primitive to this list.<br />

<strong>The</strong> graphics state also maintains the current transformation that is the transformation corresponding<br />

to the modeling hierarchy. <strong>The</strong> graphics state also contains a current displacement<br />

shader (RiDisplacement) and an imager (RiImager).<br />

<strong>The</strong> <strong>RenderMan</strong> <strong>Interface</strong> predefines standard shaders for light sources, surfaces, and volumes.<br />

<strong>The</strong>se standard shaders are available in all rendering programs that implement the<br />

<strong>RenderMan</strong> <strong>Interface</strong>, even if some algorithmic limitation prevents them from supporting<br />

programmable shaders. Standard and implementation-dependent shaders should always<br />

be specified in the Shading Language, even if they are built in. <strong>The</strong> predefined shaders<br />

provided by the Shading Language are listed in Table 10.1, Standard Shaders. <strong>The</strong>re is also<br />

a null shader that is used as a placeholder. Shading Language definitions for these shaders<br />

are given in Appendix A.<br />

112

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

Saved successfully!

Ooh no, something went wrong!