Catlike Coding
Unity Code Documentation
Static Public Member Functions | List of all members
CatlikeCoding.Noise.PerlinNoise Class Reference

A collection of methods to sample Perlin Noise. More...

Static Public Member Functions

static float Sample2D (Vector2 point, float frequency)
 Sample 2D Perlin noise. More...
 
static float Sample2D (Vector2 point, float frequency, int octaves, float lacunarity, float persistence)
 Sample multi-frequency 2D Perlin noise. More...
 
static float Sample2DTiledX (Vector2 point, int xOffset, int frequency)
 Sample 2D Perlin noise, tiled in the X dimension. More...
 
static float Sample2DTiledX (Vector2 point, Vector2 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 2D Perlin noise, tiled in the X dimension. More...
 
static float Sample2DTiledXY (Vector2 point, int xOffset, int yOffset, int frequency)
 Sample 2D Perlin noise, tiled in both dimensions. More...
 
static float Sample2DTiledXY (Vector2 point, Vector2 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 2D Perlin noise, tiled in both dimensions. More...
 
static float Sample3D (Vector3 point, float frequency)
 Sample 3D Perlin noise. More...
 
static float Sample3D (Vector3 point, float frequency, int octaves, float lacunarity, float persistence)
 Sample multi-frequency 3D Perlin noise. More...
 
static float Sample3DTiledX (Vector3 point, int xOffset, int frequency)
 Sample 3D Perlin noise, tiled in the X dimension. More...
 
static float Sample3DTiledX (Vector3 point, Vector3 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 3D Perlin noise, tiled in the X dimension. More...
 
static float Sample3DTiledXY (Vector3 point, int xOffset, int yOffset, int frequency)
 Sample 3D Perlin noise, tiled in the X and Y dimensions. More...
 
static float Sample3DTiledXY (Vector3 point, Vector3 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 3D Perlin noise, tiled in the X and Y dimensions. More...
 
static float Sample3DTiledXYZ (Vector3 point, int xOffset, int yOffset, int zOffset, int frequency)
 Sample 3D Perlin noise, tiled in the X and Y dimensions. More...
 
static float Sample3DTiledXYZ (Vector3 point, Vector3 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 3D Perlin noise, tiled in all three dimensions. More...
 
static float SampleTurbulence2D (Vector2 point, float frequency, int octaves, float lacunarity, float persistence)
 Sample multi-frequency 2D Perlin Turbulence noise. More...
 
static float SampleTurbulence2DTiledX (Vector2 point, Vector2 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 2D Perlin Turbulence noise, tiled in the X dimension. More...
 
static float SampleTurbulence2DTiledXY (Vector2 point, Vector2 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 2D Perlin Turbulence noise, tiled in both dimensions. More...
 
static float SampleTurbulence3D (Vector3 point, float frequency, int octaves, float lacunarity, float persistence)
 Sample multi-frequency 3D Perlin Turbulence noise. More...
 
static float SampleTurbulence3DTiledX (Vector3 point, Vector3 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 3D Perlin Turbulence noise, tiled in the X dimension. More...
 
static float SampleTurbulence3DTiledXY (Vector3 point, Vector3 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 3D Perlin Turbulence noise, tiled in the X and Y dimensions. More...
 
static float SampleTurbulence3DTiledXYZ (Vector3 point, Vector3 offset, int frequency, int octaves, int lacunarity, float persistence)
 Sample multi-frequency 3D Perlin Turbulence noise, also known as turbulence, tiled in all three dimensions. More...
 

Detailed Description

A collection of methods to sample Perlin Noise.

The single-frequency Perlin noise methods produce values from -1 to 1. The multi-frequency Perlin noise methods instead produce values from 0 to 1.

Turbulence noise is a variant of Perlin noise where the absolute values of multiple frequencies are summed.

Tiled versions have offsets used for moving the tiling area to another spot in the noise domain. For the tiling dimensions, the integer parts are used to offset the cells, while the fractional parts are used to offset sampling within the tile. Animating these offsets will result in popping when they cross integer boundaries as the sampling switches to another tile. Frequency and lacunarity are integers for the tiled versions because they must be aligned with cell boundaries.

The 3D Perlin noise code is based on Ken Perlin's Improved Noise reference implementation. The 2D versions use 16 gradients, which produces a slightly more wavy pattern than the 3D versions.

Member Function Documentation

static float CatlikeCoding.Noise.PerlinNoise.Sample2D ( Vector2  point,
float  frequency 
)
static

Sample 2D Perlin noise.

Returns
The noise value.
Parameters
pointSample point in 2D.
frequencyFrequency of the noise.
static float CatlikeCoding.Noise.PerlinNoise.Sample2D ( Vector2  point,
float  frequency,
int  octaves,
float  lacunarity,
float  persistence 
)
static

Sample multi-frequency 2D Perlin noise.

Returns
The noise value.
Parameters
pointSample point in 2D.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.Sample2DTiledX ( Vector2  point,
int  xOffset,
int  frequency 
)
static

Sample 2D Perlin noise, tiled in the X dimension.

Returns
The noise value.
Parameters
pointSample point in 3D.
xOffsetX offset of the tiling domain.
frequencyFrequency of the noise.
static float CatlikeCoding.Noise.PerlinNoise.Sample2DTiledX ( Vector2  point,
Vector2  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 2D Perlin noise, tiled in the X dimension.

Returns
The noise value.
Parameters
pointSample point in 2D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.Sample2DTiledXY ( Vector2  point,
int  xOffset,
int  yOffset,
int  frequency 
)
static

Sample 2D Perlin noise, tiled in both dimensions.

Returns
The noise value.
Parameters
pointSample point in 2D.
xOffsetX offset of the tiling domain.
yOffsetY offset of the tiling domain.
frequencyFrequency of the noise.
static float CatlikeCoding.Noise.PerlinNoise.Sample2DTiledXY ( Vector2  point,
Vector2  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 2D Perlin noise, tiled in both dimensions.

Returns
The noise value.
Parameters
pointSample point in 2D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.Sample3D ( Vector3  point,
float  frequency 
)
static

Sample 3D Perlin noise.

Returns
The noise value.
Parameters
pointSample point in 3D.
frequencyFrequency of the noise.
static float CatlikeCoding.Noise.PerlinNoise.Sample3D ( Vector3  point,
float  frequency,
int  octaves,
float  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin noise.

Returns
The noise value.
Parameters
pointSample point in 3D.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.Sample3DTiledX ( Vector3  point,
int  xOffset,
int  frequency 
)
static

Sample 3D Perlin noise, tiled in the X dimension.

Returns
The noise value.
Parameters
pointSample point in 3D.
xOffsetX offset of the tiling domain.
frequencyFrequency of the noise.
static float CatlikeCoding.Noise.PerlinNoise.Sample3DTiledX ( Vector3  point,
Vector3  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin noise, tiled in the X dimension.

Returns
The noise value.
Parameters
pointSample point in 3D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.Sample3DTiledXY ( Vector3  point,
int  xOffset,
int  yOffset,
int  frequency 
)
static

Sample 3D Perlin noise, tiled in the X and Y dimensions.

Returns
The noise value.
Parameters
pointSample point in 3D.
xOffsetX offset of the tiling domain.
yOffsetY offset of the tiling domain.
frequencyFrequency of the noise.
static float CatlikeCoding.Noise.PerlinNoise.Sample3DTiledXY ( Vector3  point,
Vector3  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin noise, tiled in the X and Y dimensions.

Returns
The noise value.
Parameters
pointSample point in 3D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.Sample3DTiledXYZ ( Vector3  point,
int  xOffset,
int  yOffset,
int  zOffset,
int  frequency 
)
static

Sample 3D Perlin noise, tiled in the X and Y dimensions.

Returns
The noise value.
Parameters
pointSample point in 3D.
xOffsetX offset of the tiling domain.
yOffsetY offset of the tiling domain.
zOffsetZ offset of the tiling domain.
frequencyFrequency of the noise.
static float CatlikeCoding.Noise.PerlinNoise.Sample3DTiledXYZ ( Vector3  point,
Vector3  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin noise, tiled in all three dimensions.

Returns
The noise value.
Parameters
pointSample point in 3D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.SampleTurbulence2D ( Vector2  point,
float  frequency,
int  octaves,
float  lacunarity,
float  persistence 
)
static

Sample multi-frequency 2D Perlin Turbulence noise.

Returns
The noise value.
Parameters
pointSample point in 2D.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.SampleTurbulence2DTiledX ( Vector2  point,
Vector2  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 2D Perlin Turbulence noise, tiled in the X dimension.

Returns
The noise value.
Parameters
pointSample point in 2D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.SampleTurbulence2DTiledXY ( Vector2  point,
Vector2  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 2D Perlin Turbulence noise, tiled in both dimensions.

Returns
The noise value.
Parameters
pointSample point in 2D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.SampleTurbulence3D ( Vector3  point,
float  frequency,
int  octaves,
float  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin Turbulence noise.

Returns
The noise value.
Parameters
pointSample point in 3D.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.SampleTurbulence3DTiledX ( Vector3  point,
Vector3  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin Turbulence noise, tiled in the X dimension.

Returns
The noise value.
Parameters
pointSample point in 3D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.SampleTurbulence3DTiledXY ( Vector3  point,
Vector3  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin Turbulence noise, tiled in the X and Y dimensions.

Returns
The noise value.
Parameters
pointSample point in 3D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.
static float CatlikeCoding.Noise.PerlinNoise.SampleTurbulence3DTiledXYZ ( Vector3  point,
Vector3  offset,
int  frequency,
int  octaves,
int  lacunarity,
float  persistence 
)
static

Sample multi-frequency 3D Perlin Turbulence noise, also known as turbulence, tiled in all three dimensions.

Returns
The noise value.
Parameters
pointSample point in 3D.
offsetOffset of the tiling domain.
frequencyBase frequency.
octavesAmount of octaves.
lacunarityFrequency multiplier for successive octaves.
persistenceAmplitude multiplier for succesive octaves.