|
chombo-discharge
|
Class that implements the improved Perlin noise function. More...
#include <CD_PerlinSdf.H>


Public Member Functions | |
| PerlinSdf (const Real a_noiseAmp, const RealVect a_noiseFreq, const Real a_persistence, const int a_octaves, const bool a_reseed=false) | |
| Full constructor. | |
| PerlinSdf (const PerlinSdf &a_inputIF) | |
| Copy constructor. | |
| virtual | ~PerlinSdf () |
| Destructor. | |
| virtual Real | value (const RealVect &a_pos) const |
| Level-set function. | |
| virtual BaseIF * | newImplicitFunction () const |
| Factory method. | |
Static Public Member Functions | |
| static int | random (const int i) |
| Simple random number generator. | |
Protected Member Functions | |
| virtual void | reseed () |
| Reseed function. | |
| double | noise (const double a_x, const double a_y, const double a_z) const |
| Ken Perlin's 3D noise function. | |
| Real | noise (const RealVect &a_pos) const |
| Chombo interface to Perlin noise function. | |
| Real | octaveNoise (const RealVect &a_pos) const |
| Octave noise function. Returns noise over over several octaves. | |
| Real | lerp (const Real t, const Real a, const Real b) const |
| Interpolation function. | |
| Real | fade (const Real t) const |
| Fade function. | |
| Real | grad (const int hash, const double x, const double y, const double z) const |
| Gradient function using hash table lookup. | |
Protected Attributes | |
| RealVect | m_noiseFreq |
| Perlin noise frequency. | |
| Real | m_noiseAmp |
| Perlin noise amplitude. | |
| Real | m_persistence |
| Perlin octave fade factor. | |
| int | m_octaves |
| Number of octaves to use for noise. | |
| double | p [512] |
| Permutation table. | |
Static Protected Attributes | |
| static constexpr int | m_permutationTable [256] |
| Ken Perlin's original permutation array. | |
Class that implements the improved Perlin noise function.
Typically, you will use this function to displace a level-set function by using SumIF. However, Perlin noise is also a signed distance function, and so it can be used as an implicit function as well.
| PerlinSdf::PerlinSdf | ( | const Real | a_noiseAmp, |
| const RealVect | a_noiseFreq, | ||
| const Real | a_persistence, | ||
| const int | a_octaves, | ||
| const bool | a_reseed = false |
||
| ) |
Full constructor.
| [in] | a_noiseAmp | Noise amplitude |
| [in] | a_noiseFreq | Base frequency |
| [in] | a_octaves | Number of octaves to use for Perlin noise |
| [in] | a_persistence | Reduction factor for each octave |
| [in] | a_reseed | Reseed permutation vector (true) or use Ken Perlin's original one (false) |
Copy constructor.
| [in] | a_inputIF | Input PerlinSdf |
Ken Perlin's 3D noise function.
For 2D, we use Ken Perlin's function with z = 0
| [in] | a_x | Position |
| [in] | a_y | Position |
| [in] | a_z | Position |
Octave noise function. Returns noise over over several octaves.
normFrac;
Level-set function.
| [in] | a_pos | Position |
Ken Perlin's original permutation array.