Main Index : Reference :

Noise


Description

Used to generate different kinds of noise fields.

Definition

class Noise
{
public:
  Noise();
  
  // Between 0 and 1
  [float] Noise([float] a, [[float] b], [[float] c], [[float] d]]);

  // Between -1 and 1
  [float] SNoise ([float] a, [[float] b], [[float] c], [[float] d]]);

  // Between -2 and 2
  [float] Turbulence([float] octaves, [bool] abs, 
                     [float] a, [[float] b], [[float] c], [[float] d]); 
  
  // Called once before Fbm and RMf
  [void] InitFbm([float] lacunarity, [float] h); 
  
  // Between -2 and 2
  [float] Fbm([float] octaves, [float] a, [[float] b], [[float] c], [[float] d]); 
  
  // Between -2 and 2
  [float] RidgedMultifractal([float] octaves, [float] offset, [float] gain, 
                             [float] a, [[float] b], [[float] c], [[float] d]); 
};

Explanation

The Noise class contains functions to get the value at a certain point of different noise fields. The coordinates can be one-, two-, three- or four-dimensional, and are specified by the parameters a, b, c and d. For the lesser dimensions, the parameters that aren't used can be omitted. The noise fields don't need much memory so don't worry about the dimension. The period of the noise fields is 1024.

Before you use the Fbm() or RidgedMultifractal() functions you need to call the InitFbm() function once.

For more information on how the different noise fields work, see the book Texturing and Modelling, Ebert et al., AP Professional, ISBN 0-12-228760-6.

Members

Noise( a, [b], [c], [d] )

[float] Noise([float] a, [[float] b], [[float] c], [[float] d]]);

Returns the value at the point [a, b, c, d] in a standard noise field. The higher dimension parameters are optional. Omitted coordinates are treated as 0. The return value is between 0 and 1.

SNoise( a, [b], [c], [d] )

[float] SNoise([float] a, [[float] b], [[float] c], [[float] d]]);

Returns the value at the point [a, b, c, d] in a standard noise field. The higher dimension parameters are optional. Omitted coordinates are treated as 0. The return value is between -1 and 1.


Turbulence( octaves, abs, a, [b], [c], [d] )

[float] Turbulence([float] octaves, [bool] abs, 
                   [float] a, [[float] b], [[float] c], [[float] d]); 

Returns the value at the point [a, b, c, d] in a turbulence field. The higher dimension parameters are optional. Omitted coordinates are treated as 0. The return value is between -2 and 2 if abs is FALSE or between 0 and 2 if abs is TRUE. The octaves parameter is limited to 20.


InitFbm( lacunarity, h )

[void] InitFbm([float] lacunarity, [float] h);

Must be called once before Fbm() or RidgedMultifractal() is called.

Fbm( octaves, a, [b], [c], [d] )

[float] Fbm([float] octaves, [float] a, [[float] b], [[float] c], [[float] d]);

Returns the value at the point [a, b, c, d] in a fractal Brownian motion field. The higher dimension parameters are optional. Omitted coordinates are treated as 0. The return value is between -2 and 2. The octaves parameter is limited to 20.

RidgedMultifractal( octaves, offset, gain, a, [b], [c], [d] )

[float] RidgedMultifractal([float] octaves, [float] offset, [float] gain, 
                           [float] a, [[float] b], [[float] c], [[float] d]); 

Returns the value at the point [a, b, c, d] in a ridged multifractal field. The higher dimension parameters are optional. Omitted coordinates are treated as 0. The return value is between -2 and 2. The octaves parameter is limited to 20.

See Also

Random