Skip to content

Commit 41189d2

Browse files
committed
versioned docs
1 parent c6d6312 commit 41189d2

19 files changed

+448
-0
lines changed

doc/1.0.0/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
###### Module
2+
# Noise
3+
4+
Generate and combine commonly used procedural noise patterns and distributions.
5+
6+
*This wiki documents features present in* [Noise *1.0.0*](https://github.com/kelvin13/noise/releases/tag/1.0.0). *Many new features are currently being added to* [`master`](https://github.com/kelvin13/noise/tree/master) *for* Noise *2.0.0, and several types and methods will be deprecated or removed for 2.0.0, including* [`SimplexNoise2D`](struct-SimplexNoise2D).
7+
***
8+
9+
## Symbols
10+
11+
### Protocols
12+
13+
#### `protocol` [`Noise`](protocol-Noise)
14+
> A procedural noise generator.
15+
16+
### Structures
17+
18+
#### `struct` [`SimplexNoise2D`](struct-SimplexNoise2D)
19+
> A type of two-dimensional gradient noise (sometimes called [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise)), suitable for texturing two-dimensional planes. Simplex noise is supported in the library mainly because it has historical significance; it has since been superseded by the less popular, but more powerful and more efficient super-simplex noise.
20+
21+
#### `struct` [`SuperSimplexNoise2D`](struct-SuperSimplexNoise2D)
22+
> A type of two-dimensional gradient noise (sometimes called [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise)), suitable for texturing two-dimensional planes. Super-simplex noise is an improved version of simplex noise which runs faster and scales better to higher dimensions.
23+
24+
25+
#### `struct` [`SuperSimplexNoise3D`](struct-SuperSimplexNoise3D)
26+
> A type of three-dimensional gradient noise (sometimes called [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise)), suitable for texturing arbitrary three-dimensional objects.
27+
28+
#### `struct` [`CellNoise2D`](struct-CellNoise2D)
29+
> A type of two-dimensional cellular noise (sometimes called [Worley noise](https://en.wikipedia.org/wiki/Worley_noise), or Voronoi noise), suitable for texturing two-dimensional planes.
30+
31+
#### `struct` [`CellNoise3D`](struct-CellNoise3D)
32+
> A type of three-dimensional cellular noise (sometimes called [Worley noise](https://en.wikipedia.org/wiki/Worley_noise), or Voronoi noise), suitable for texturing arbitrary three-dimensional objects.
33+
34+
#### `struct` [`DiskSampler2D`](struct-DiskSampler2D)
35+
> A point sampler capable of producing uniform and roughly-evenly spaced pseudo-random point distributions in the plane. Disk sampling is sometimes referred to as [Poisson sampling](https://en.wikipedia.org/wiki/Supersampling#Poisson_disc).
36+
37+
#### `struct` [`FBM`](struct-FBM)
38+
> A generic [fractal brownian motion](https://thebookofshaders.com/13/) noise generator, capable of overlaying multiple instances of procedural [noise](protocol-Noise) at increasing frequencies.
39+
40+
#### `struct` [`PermutationTable`](struct-PermutationTable)
41+
> An 8-bit permutation table useful for generating pseudo-random hash values.
42+
43+
#### `struct` [`RandomXorshift`](struct-RandomXorshift)
44+
> A cryptographically unsecure 128-bit [Xorshift](https://en.wikipedia.org/wiki/Xorshift) pseudo-random number generator.

doc/1.0.0/png/banner_FBM.png

209 KB
Loading

doc/1.0.0/png/banner_cell2d.png

105 KB
Loading

doc/1.0.0/png/banner_cell3d.png

91.4 KB
Loading

doc/1.0.0/png/banner_disk2d.png

59.7 KB
Loading

doc/1.0.0/png/banner_simplex2d.png

52.4 KB
Loading
56.4 KB
Loading
54.7 KB
Loading

doc/1.0.0/png/banner_voronoi2d.png

17.5 KB
Loading

doc/1.0.0/protocol-Noise.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
###### Protocol
2+
3+
# `Noise`
4+
A procedural noise generator.
5+
6+
***
7+
8+
## Symbols
9+
10+
### Initializers
11+
12+
#### `init(amplitude:Double, frequency:Double, seed:Int)`
13+
> Creates an instance with the given `amplitude`, `frequency`, and random `seed` values. Creating an instance generates a new pseudo-random permutation table for that instance, and a new instance does not need to be regenerated to sample the same procedural noise field.
14+
15+
### Instance methods
16+
17+
#### `func` `evaluate(_ x:Double, _ y:Double) -> Double`
18+
> Evaluates the noise field at the given coordinate. For three-dimensional and higher noise fields, the `z` and `w` coordinates, if applicable, are set to zero.
19+
20+
#### `func` `evaluate(_ x:Double, _ y:Double, _ z:Double) -> Double`
21+
> Evaluates the noise field at the given coordinate. For two-dimensional noise fields, the `z` coordinate is ignored. For four-dimensional noise fields, the `w` coordinate is set to zero.
22+
23+
#### `func` `evaluate(_ x:Double, _ y:Double, _ z:Double, _ w:Double) -> Double`
24+
> Evaluates the noise field at the given coordinate. For three-dimensional and lower noise fields, the `z` and `w` coordinates are ignored, if necessary. No existing noise generator in the library currently supports true four-dimensional evaluation.
25+
26+
#### `func` `sample_area(width:Int, height:Int) -> [(Double, Double, Double)]`
27+
> Evaluates the noise field over the given area, starting from the origin, and extending over the first quadrant, taking unit steps in both directions. Although the `x` and `y` coordinates are returned, the output vector is guaranteed to be in row-major order.
28+
29+
#### `func` `sample_area_saturated_to_u8(width:Int, height:Int, offset:Double = 0.5) -> [UInt8]`
30+
> Evaluates the noise field over the given area, starting from the origin, and extending over the first quadrant, storing the values in a row-major array of samples. The samples are clamped, but not scaled, to the range `0 ... 255`.
31+
32+
#### `func` `sample_volume(width:Int, height:Int, depth:Int) -> [(Double, Double, Double, Double)]`
33+
> Evaluates the noise field over the given volume, starting from the origin, and extending over the first octant, taking unit steps in all three directions. Although the `x`, `y`, and `z` coordinates are returned, the output vector is guaranteed to be in `xy`-plane-major, and then row-major order.
34+
35+
#### `func` `sample_volume_saturated_to_u8(width:Int, height:Int, depth:Int, offset:Double = 0.5) -> [UInt8]`
36+
> Evaluates the noise field over the given volume, starting from the origin, and extending over the first octant, storing the values in a `xy`-plane-major, and then row-major order array of samples. The samples are clamped, but not scaled, to the range `0 ... 255`.

0 commit comments

Comments
 (0)