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.

<strong>The</strong> actual change in a variable is equal to its derivative with respect to a surface<br />

parameter times the change in the surface parameter. Thus, assuming forward differencing,<br />

function(u+du)-function(u) = Du( function(u) ) * du;<br />

function(v+dv)-function(v) = Dv( function(v) ) * dv;<br />

float random()<br />

color random ()<br />

point random ()<br />

random returns a float, color, or point whose components are a random number between<br />

0 and 1.<br />

float noise ( float v ), noise ( float u, v ), noise ( point pt ) noise ( point pt, float t )<br />

color noise ( float v ), noise ( float u, v ), noise ( point pt ), noise ( point pt, float t )<br />

point noise ( float v ), noise ( float u, v ), noise ( point pt ), noise ( point pt, float t )<br />

vector noise ( float v ), noise ( float u, v ), noise ( point pt ), noise ( point pt, float t )<br />

noise returns a value which is a pseuodrandom function of its arguments; its value<br />

is always between 0 and 1. <strong>The</strong> domain of this noise function can be 1-D (one float),<br />

2-D (two floats), 3-D (one point), or 4-D (one point and one float). <strong>The</strong>se functions<br />

can return any type. <strong>The</strong> type desired is indicated by casting the function to the type<br />

desired. <strong>The</strong> following statement causes noise to return a color.<br />

c = 2 * color noise(P);<br />

float pnoise ( float v, uniform float period ),<br />

pnoise ( float u, v, uniform float uperiod, uniform float vperiod ),<br />

pnoise ( point pt, uniform point pperiod ),<br />

pnoise ( point pt, float t, uniform point pperiod, uniform float tperiod )<br />

color pnoise ( float v, uniform float period ),<br />

pnoise ( float u, v, uniform float uperiod, uniform float vperiod ),<br />

pnoise ( point pt, uniform point pperiod ),<br />

pnoise ( point pt, float t, uniform point pperiod, uniform float tperiod )<br />

point pnoise ( float v, uniform float period ),<br />

pnoise ( float u, v, uniform float uperiod, uniform float vperiod ),<br />

pnoise ( point pt, uniform point pperiod ),<br />

pnoise ( point pt, float t, uniform point pperiod, uniform float tperiod )<br />

vector pnoise ( float v, uniform float period ),<br />

pnoise ( float u, v, uniform float uperiod, uniform float vperiod ),<br />

pnoise ( point pt, uniform point pperiod ),<br />

pnoise ( point pt, float t, uniform point pperiod, uniform float tperiod )<br />

pnoise returns a value similar to noise with the same arguments, however, the value<br />

returned by pnoise is periodic with period period (or pperiod, tperiod, etc.). That is,<br />

pnoise(v, p) == pnoise(v+p, p). <strong>The</strong> period parameters must be uniform and have an<br />

integer value (if it is a float expression), or lie on the integer lattice (if it is a point<br />

expression).<br />

136

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

Saved successfully!

Ooh no, something went wrong!