Ocular Engine
Ocular::Math::Noise::WaveletNoise Class Reference

#include <WaveletNoise.hpp>

Inheritance diagram for Ocular::Math::Noise::WaveletNoise:
Ocular::Math::Noise::ANoise

Public Member Functions

 WaveletNoise (int32_t dimensions=64)
 
virtual float getValue (float const x)
 
virtual float getValue (float const x, float const y)
 
virtual float getValue (float const x, float const y, float const z)
 
float getValue (float const pX, float const pY, float const pZ, float const nX, float const nY, float const nZ)
 
void setBandWeights (std::vector< float > const &weights)
 
void setScale (float const scale)
 

Protected Member Functions

void generate ()
 
void downsample (float *from, float *to, int32_t n, int32_t stride)
 
void upsample (float *from, float *to, int32_t n, int32_t stride)
 
float getRawNoise (Vector3f const &position)
 
float getRawProjectedNoise (Vector3f const &position, Vector3f const &normals)
 

Detailed Description

Wavelet Noise is a coherent gradient noise generation algorithm developed by Pixar. Compared to Perlin and Simplex noise it suffers less from aliasing and detail loss, especially at extreme angles.

Whereas with Perlin and Simplex noise, the generated output could be customized by setting octave/scale/persistence, with Wavelet noise one can set the weight values of the individual bands of noise and a scaling factor.

Robert L. Cook & Tony DeRose, Pixar Animation Studios: Wavelet Noise http://graphics.pixar.com/library/WaveletNoise/paper.pdf

Constructor & Destructor Documentation

Ocular::Math::Noise::WaveletNoise::WaveletNoise ( int32_t  dimensions = 64)
Parameters
[in]dimensionsSize of the internal noise tile. Suggested values are on the range [32, 256].

Member Function Documentation

float Ocular::Math::Noise::WaveletNoise::getValue ( float const  x)
virtual

1D slice of unprojected 3D Wavelet Noise.

Parameters
[in]x
Returns
Value on range [-1.0, 1.0]

Reimplemented from Ocular::Math::Noise::ANoise.

float Ocular::Math::Noise::WaveletNoise::getValue ( float const  x,
float const  y 
)
virtual

2D slice of unprojected 3D Wavelet Noise.

Parameters
[in]x
[in]y
Returns
Value on range [-1.0, 1.0]

Reimplemented from Ocular::Math::Noise::ANoise.

float Ocular::Math::Noise::WaveletNoise::getValue ( float const  x,
float const  y,
float const  z 
)
virtual

Unprojected 3D Wavelet Noise.

Parameters
[in]x
[in]y

Reimplemented from Ocular::Math::Noise::ANoise.

float Ocular::Math::Noise::WaveletNoise::getValue ( float const  pX,
float const  pY,
float const  pZ,
float const  nX,
float const  nY,
float const  nZ 
)

3D Wavelet Noise projected onto a 2D surface.

Parameters
[in]pXPosition X
[in]pYPosition Y
[in]pZPosition Z
[in]nXNormal X
[in]nYNormal Y
[in]nZNormal Z
Returns
Value on range [-1.0, 1.0]
void Ocular::Math::Noise::WaveletNoise::setBandWeights ( std::vector< float > const &  weights)

Sets the band weights for multibanded Wavelet Noise. Pass in a vector with length 0 to get the raw Wavelet Noise.

Parameters
[in]weightsIndividual weights for each band of noise. Number of bands is suggested to be anywhere from 0 (Raw) to as high as 15. See Figure 10 in the source paper linked in this class' description for sample bands.
void Ocular::Math::Noise::WaveletNoise::setScale ( float const  scale)

Sets the scaling factor of the noise.

Parameters
[in]scale

The documentation for this class was generated from the following files: