
previous | next | stochastic patterns: contents | rmannotes: top

Irregular patterns have stochastic components. In this context, stochastic functions appear random but actually aren't random at all. Rather, they are pseudo-random -- functions which appear to have random output but are actually repeatable given the same input. The basic tool for building stochastic functions is the noise function [Ebert94] [Perlin85] [Perlin89] [Lewis89] .
There are many ways to implement a "noise" function. The RManNotes pages will focus on the use of noise as implemented in PRMan and BMRT. You should consult [Ebert94] for an excellent survey of properties and implementations of various noise functions (esp Chapter 2 by Peachey).
One-dimensional noise.
Adapted from
[Apodaca92].
The noise function in the RenderMan Shading Langauge has several important characteristics:
float output).
Ci = float noise(s * 5, t * 5)
color output).
Ci = color noise(s * 5, t * 5)
The input of noise is commonly manipulated using simple transformations such as shifting by an offset or scaling by some frequency. For example,
noise(x + offset)adds an offset to the noise inputs which results in shifting the outputs. While,
noise(x * frequency)increases or decreases the frequency (for frequency values greater than 1 or less than 1 respectively). Most commonly, both of these transformations are used along with an output scaling factor to adjust amplitude.
noise(x * frequency + offset) * amplitude
It's not always convenient to have a noise function with strictly positive outputs. The snoise function produces a 1D (input and output) noise function with output values in the range [-1,1] in the spirit of the noise function described by [Perlin85].
|
RManNotes function
float snoise(float x) These return the value of noise scaled to [-1,1]. Note: the 1D and 3D functions have the same name. |
The noise function has a tendency to generate output values which lie near the value 0.5. udn and udn2 (Uniformly Distributed Noise) can be used instead of noise to generate values which are more uniformly distributed over some range.
|
RManNotes function
float udn(float x, lo, hi) 1D, 3D, and 2D uniformly distributed noise over the range lo to hi. Note: the 1D and 3D functions have the same name. |
A uniform distribution of values is particularly useful when
randomly varying some pattern. For example, if you used noise to randomly
choose a solid color for each tile in a regular pattern, it is likely that
some colors would
appear more frequently than others. This is not as likely to happen if
you use udn instead.

previous | next | stochastic patterns: contents | rmannotes: top

RManNotes is Copyright © 1995, 1996 Stephen F. May
Any comments or suggestions appreciated.
Steve May (smay@pixar.com)Last Modified: 4/16/96