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.
13.3 Illuminance and Illuminate Statements<br />
<strong>The</strong> Shading Language contains three new block statement constructs: illuminance, illuminate,<br />
and solar. illuminance is used to control the integration of incoming light over a<br />
hemisphere centered on a surface in a surface shader. illuminate and solar are used to specify<br />
the directional properties of light sources in light shaders. If a light source does not<br />
have an illuminate or solar statement, it is a non-directional ambient light source.<br />
Unlike other control statements, illuminance, illuminate, and solar statements cannot be<br />
nested. However, multiple illuminance, illuminate, or solar statements may be given sequentially<br />
within a single shader.<br />
<strong>The</strong> illuminance statement controls integration of a procedural reflectance model over the<br />
incoming light. Inside the illuminance block two additional variables are defined: Cl or<br />
light color, and L or light direction. <strong>The</strong> vector L points towards the light source, but may<br />
not be normalized (see Figure 12.2). <strong>The</strong> arguments to the illuminance statement specify a<br />
three-dimensional solid cone. <strong>The</strong> two forms of an illuminance statement are:<br />
illuminance( [string category,] point position )<br />
statements<br />
illuminance( [string category,] point position, vector axis, float angle )<br />
statements<br />
<strong>The</strong> first form specifies that the integral extends over the entire sphere centered at position.<br />
<strong>The</strong> second form integrates over a cone whose apex is on the surface at position. This cone<br />
is specified by giving its centerline, and the angle between the side and the axis in radians.<br />
If angle is PI, the cone extends to cover the entire sphere and these forms are the same as<br />
the first form. If angle is PI/2, the cone subtends a hemisphere with the north pole in the<br />
direction axis. Finally, if angle is 0, the cone reduces to an infinitesimally thin ray.<br />
Light shaders can specify “categories” to which they belong by declaring a string parameter<br />
named category (this name has two underscores), whose value is a comma-separated<br />
list of categories into which the light shader falls. When the illuminance statement contains<br />
an optional string parameter category, the loop will only consider lights for which<br />
the category is among those listed in its comma-separated category list. If the illuminance<br />
category begins with a - character, then only lights not containing that category will<br />
be considered.<br />
When the optional category string is omitted, an illuminance loop will execute its body for<br />
every nonambient light source.<br />
A Lambertian shading model is expressed simply using the illuminance statement:<br />
Nn = normalize(N);<br />
illuminance( P, Nn, PI/2 ) {<br />
Ln = normalize(L);<br />
Ci += Cs * Cl * Ln.Nn;<br />
}<br />
127