Catlike Coding
Unity Code Documentation
|
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... | |
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.
|
static |
Sample 2D Perlin noise.
point | Sample point in 2D. |
frequency | Frequency of the noise. |
|
static |
Sample multi-frequency 2D Perlin noise.
point | Sample point in 2D. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample 2D Perlin noise, tiled in the X dimension.
point | Sample point in 3D. |
xOffset | X offset of the tiling domain. |
frequency | Frequency of the noise. |
|
static |
Sample multi-frequency 2D Perlin noise, tiled in the X dimension.
point | Sample point in 2D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample 2D Perlin noise, tiled in both dimensions.
point | Sample point in 2D. |
xOffset | X offset of the tiling domain. |
yOffset | Y offset of the tiling domain. |
frequency | Frequency of the noise. |
|
static |
Sample multi-frequency 2D Perlin noise, tiled in both dimensions.
point | Sample point in 2D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample 3D Perlin noise.
point | Sample point in 3D. |
frequency | Frequency of the noise. |
|
static |
Sample multi-frequency 3D Perlin noise.
point | Sample point in 3D. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample 3D Perlin noise, tiled in the X dimension.
point | Sample point in 3D. |
xOffset | X offset of the tiling domain. |
frequency | Frequency of the noise. |
|
static |
Sample multi-frequency 3D Perlin noise, tiled in the X dimension.
point | Sample point in 3D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample 3D Perlin noise, tiled in the X and Y dimensions.
point | Sample point in 3D. |
xOffset | X offset of the tiling domain. |
yOffset | Y offset of the tiling domain. |
frequency | Frequency of the noise. |
|
static |
Sample multi-frequency 3D Perlin noise, tiled in the X and Y dimensions.
point | Sample point in 3D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample 3D Perlin noise, tiled in the X and Y dimensions.
point | Sample point in 3D. |
xOffset | X offset of the tiling domain. |
yOffset | Y offset of the tiling domain. |
zOffset | Z offset of the tiling domain. |
frequency | Frequency of the noise. |
|
static |
Sample multi-frequency 3D Perlin noise, tiled in all three dimensions.
point | Sample point in 3D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample multi-frequency 2D Perlin Turbulence noise.
point | Sample point in 2D. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample multi-frequency 2D Perlin Turbulence noise, tiled in the X dimension.
point | Sample point in 2D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample multi-frequency 2D Perlin Turbulence noise, tiled in both dimensions.
point | Sample point in 2D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample multi-frequency 3D Perlin Turbulence noise.
point | Sample point in 3D. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample multi-frequency 3D Perlin Turbulence noise, tiled in the X dimension.
point | Sample point in 3D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample multi-frequency 3D Perlin Turbulence noise, tiled in the X and Y dimensions.
point | Sample point in 3D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |
|
static |
Sample multi-frequency 3D Perlin Turbulence noise, also known as turbulence, tiled in all three dimensions.
point | Sample point in 3D. |
offset | Offset of the tiling domain. |
frequency | Base frequency. |
octaves | Amount of octaves. |
lacunarity | Frequency multiplier for successive octaves. |
persistence | Amplitude multiplier for succesive octaves. |