RidgedMulti

Noise module that outputs 3-dimensional ridged-multifractal noise.

@image html moduleridgedmulti.png

This noise module, heavily based on the Perlin-noise module, generates ridged-multifractal noise. Ridged-multifractal noise is generated in much of the same way as Perlin noise, except the output of each octave is modified by an absolute-value function. Modifying the octave values in this way produces ridge-like formations.

Ridged-multifractal noise does not use a persistence value. This is because the persistence values of the octaves are based on the values generated from from previous octaves, creating a feedback loop (or that's what it looks like after reading the code.)

This noise module outputs ridged-multifractal-noise values that usually range from -1.0 to +1.0, but there are no guarantees that all output values will exist within that range.

@note For ridged-multifractal noise generated with only one octave, the output value ranges from -1.0 to 0.0.

Ridged-multifractal noise is often used to generate craggy mountainous terrain or marble-like textures.

This noise module does not require any source modules.

<b>Octaves</b>

The number of octaves control the <i>amount of detail</i> of the ridged-multifractal noise. Adding more octaves increases the detail of the ridged-multifractal noise, but with the drawback of increasing the calculation time.

An application may specify the number of octaves that generate ridged-multifractal noise by calling the SetOctaveCount() method.

<b>Frequency</b>

An application may specify the frequency of the first octave by calling the SetFrequency() method.

<b>Lacunarity</b>

The lacunarity specifies the frequency multipler between successive octaves.

The effect of modifying the lacunarity is subtle; you may need to play with the lacunarity value to determine the effects. For best results, set the lacunarity to a number between 1.5 and 3.5.

<b>References &amp; Acknowledgments</b>

<a href=http://www.texturingandmodeling.com/Musgrave.html>F. Kenton "Doc Mojo" Musgrave's texturing page</a> - This page contains links to source code that generates ridged-multfractal noise, among other types of noise. The source file <a href=http://www.texturingandmodeling.com/CODE/MUSGRAVE/CLOUD/fractal.c> fractal.c</a> contains the code I used in my ridged-multifractal class (see the @a RidgedMultifractal() function.) This code was written by F. Kenton Musgrave, the person who created <a href=http://www.pandromeda.com/>MojoWorld</a>. He is also one of the authors in <i>Texturing and Modeling: A Procedural Approach</i> (Morgan Kaufmann, 2002. ISBN 1-55860-848-6.)

Constructors

this
this()

Constructor.

Members

Functions

CalcSpectralWeights
void CalcSpectralWeights()

Calculates the spectral weights for each octave.

GetFrequency
double GetFrequency()

Returns the frequency of the first octave.

GetLacunarity
double GetLacunarity()

Returns the lacunarity of the ridged-multifractal noise.

GetNoiseQuality
NoiseQuality GetNoiseQuality()

Returns the quality of the ridged-multifractal noise.

GetOctaveCount
int GetOctaveCount()

Returns the number of octaves that generate the ridged-multifractal noise.

GetSeed
int GetSeed()

Returns the seed value used by the ridged-multifractal-noise function.

GetSourceModCount
int GetSourceModCount()
Undocumented in source. Be warned that the author may not have intended to support it.
GetValue
double GetValue(double x, double y, double z)
Undocumented in source. Be warned that the author may not have intended to support it.
SetFrequency
void SetFrequency(double frequency)

Sets the frequency of the first octave.

SetLacunarity
void SetLacunarity(double lacunarity)

Sets the lacunarity of the ridged-multifractal noise.

SetNoiseQuality
void SetNoiseQuality(NoiseQuality noiseQuality)

Sets the quality of the ridged-multifractal noise.

SetOctaveCount
void SetOctaveCount(int octaveCount)

Sets the number of octaves that generate the ridged-multifractal noise.

SetSeed
void SetSeed(int seed)

Sets the seed value used by the ridged-multifractal-noise function.

Variables

m_frequency
double m_frequency;

Frequency of the first octave.

m_lacunarity
double m_lacunarity;

Frequency multiplier between successive octaves.

m_noiseQuality
NoiseQuality m_noiseQuality;

Quality of the ridged-multifractal noise.

m_octaveCount
int m_octaveCount;

Total number of octaves that generate the ridged-multifractal noise.

m_pSpectralWeights
double[RIDGED_MAX_OCTAVE] m_pSpectralWeights;

Contains the spectral weights for each octave.

m_seed
int m_seed;

Seed value used by the ridged-multfractal-noise function.

Inherited Members

From Mod

~this
~this()

Destructor.

GetSourceMod
const(Mod) GetSourceMod(int index)

Returns a reference to a source module connected to this noise module.

GetSourceModCount
int GetSourceModCount()

Returns the number of source modules required by this noise module.

GetValue
double GetValue(double x, double y, double z)

Generates an output value given the coordinates of the specified input value.

SetSourceMod
void SetSourceMod(int index, const(Mod)* sourceMod)

Connects a source module to this noise module.

m_pSourceMod
const(Mod)*[] m_pSourceMod;

An array containing the pointers to each source module required by this noise module.

Meta