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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

15.7.1 Basic texture maps<br />

Basic texture maps return either floats or colors.<br />

float texture ( string name[channel]; [texture coordinates,] [parameterlist] )<br />

color texture ( string name[channel]; [texture coordinates,] [parameterlist] )<br />

where texture coordinates is one of the following:<br />

float s, t;<br />

float s1,t1, s2,t2, s3,t3, s4,t4;<br />

Return the filtered texture value. <strong>The</strong> cast before the function determines the type<br />

returned, either a float or a color. <strong>The</strong> name is the name of the texture map created<br />

using RiMakeTexture. <strong>The</strong> channel selector is optional; if it is not present, the brackets<br />

are also omitted and channel 0 is assumed. channel selects the starting channel<br />

in the texture. <strong>The</strong> number of channels returned depends on whether the texture<br />

is interpreted as a float or a color. texture coordinates are also optional. If present<br />

they consist either of a single 2-D coordinate or four 2-D coordinates. If no texture<br />

coordinates are given, the current values of (s,t) are used. parameterlist is a list of<br />

name-value pairs that allow greater control over texture access.<br />

Some examples of the use of this function are:<br />

c = texture( ”logo” [0] );<br />

c = color texture ( ”logo” );<br />

c = color texture ( ”logo”, 2*s, 4*t );<br />

In the first two cases, the texture coordinates are the current values of the predefined<br />

variables (s,t).<br />

15.7.2 Environment maps<br />

float environment ( string name[channel]; texture coordinates, [parameterlist] )<br />

color environment ( string name[channel]; texture coordinates, [parameterlist] )<br />

where texture coordinates is one of the following:<br />

point R;<br />

point R1, R2, R3, R4;<br />

Return the filtered texture value from an environment map. <strong>The</strong> cast before the function<br />

determines the type returned, either a float or a color. <strong>The</strong> name is the name<br />

of the texture map created using RiMake...Environment. <strong>The</strong> channel selector is optional;<br />

if it is not present, the brackets are also omitted and channel 0 is assumed.<br />

channel selects the starting channel in the texture. <strong>The</strong> number of channels returned<br />

depends on whether the texture is interpreted as a float or a color. This function expects<br />

either a single texture coordinate or four texture coordinates. <strong>The</strong>se are points<br />

that are used to define a direction in space. <strong>The</strong> length of this vector is unimportant.<br />

parameterlist is a list of name-value pairs which allow greater control over texture<br />

access.<br />

145

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

Saved successfully!

Ooh no, something went wrong!