The RenderMan Interface - Paul Bourke
The RenderMan Interface - Paul Bourke
The RenderMan Interface - Paul Bourke
- 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.
Section 9<br />
OVERVIEW OF THE SHADING PROCESS<br />
In this document, shading includes the entire process of computing the color of a point on a<br />
surface or at a pixel. <strong>The</strong> shading process requires the specification of light sources, surface<br />
material properties, volume or atmospheric effects, and pixel operations. <strong>The</strong> interpolation of<br />
color across a primitive, in the sense of Gouraud or Phong interpolation, is not considered<br />
part of the shading process. Each part of the shading process is controlled by giving a<br />
function which mathematically describes that part of the shading process. Throughout this<br />
document the term shader refers to a procedure that implements one of these processes.<br />
<strong>The</strong>re are thus five major types of shaders:<br />
• Light source shaders. Lights may exist alone or be attached to geometric primitives. A<br />
light source shader calculates the color of the light emitted from a point on the light<br />
source towards a point on the surface being illuminated. A light will typically have a<br />
color or spectrum, an intensity, a directional dependency and a fall-off with distance.<br />
• Displacement shaders. <strong>The</strong>se shaders change the position and normals of points on the<br />
surface, in order to place bumps on surfaces.<br />
• Surface shaders. Surface shaders are attached to all geometric primitives and are<br />
used to model the optical properties of materials from which the primitive was constructed.<br />
A surface shader computes the light reflected in a particular direction by<br />
summing over the incoming light and considering the properties of the surface<br />
• Volume shaders. Volume shaders modulate the color of a light ray as it travels through<br />
a volume. Volumes are defined as the insides of solid objects. <strong>The</strong> atmosphere is the<br />
initial volume defined before any objects are created.<br />
• Imager shader. Imager shaders are used to program pixel operations that are done<br />
before the image is quantized and output.<br />
Conceptually, it is easiest to envision the shading process using ray tracing (see Figure 9.1).<br />
In the classic recursive ray tracer, rays are cast from the eye through a point on the image<br />
plane. Each ray intersects a surface which causes new rays to be spawned and traced<br />
recursively. <strong>The</strong>se rays are typically directed towards the light sources and in the directions<br />
of maximum reflection and transmittance. Whenever a ray travels through space, its color<br />
and intensity is modulated by the volume shader attached to that region of space. If that<br />
region is inside a solid object, the volume shader is the one associated with the interior of<br />
109