Skip to content

Commit 14eb453

Browse files
committed
look what they (our past selves) needed to mimic a fraction of our power
1 parent 9e1adad commit 14eb453

11 files changed

+21
-32
lines changed

Sources/Noise/docs.docc/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
###### Module
2-
# Noise
1+
# ``Noise``
32

43
Generate and combine commonly used procedural noise patterns and distributions.
54

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.md).
5+
*This wiki documents features present in* [Noise *1.0.0*](https://github.com/tayloraswift/noise/releases/tag/1.0.0). *Many new features are currently being added to* [`master`](https://github.com/tayloraswift/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.md).
76
***
87

98
## Symbols
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
###### Protocol
1+
# ``Noise``
22

3-
# `Noise`
43
A procedural noise generator.
54

65
***
76

8-
## Symbols
7+
## Symbols
98

109
### Initializers
1110

1211
#### `init(amplitude:Double, frequency:Double, seed:Int)`
1312
> 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.
1413
15-
### Instance methods
14+
### Instance methods
1615

1716
#### `func` `evaluate(_ x:Double, _ y:Double) -> Double`
1817
> 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.
@@ -23,14 +22,14 @@ A procedural noise generator.
2322
#### `func` `evaluate(_ x:Double, _ y:Double, _ z:Double, _ w:Double) -> Double`
2423
> 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.
2524
26-
#### `func` `sample_area(width:Int, height:Int) -> [(Double, Double, Double)]`
25+
#### `func` `sample_area(width:Int, height:Int) -> [(Double, Double, Double)]`
2726
> 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.
2827
29-
#### `func` `sample_area_saturated_to_u8(width:Int, height:Int, offset:Double = 0.5) -> [UInt8]`
28+
#### `func` `sample_area_saturated_to_u8(width:Int, height:Int, offset:Double = 0.5) -> [UInt8]`
3029
> 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`.
3130
32-
#### `func` `sample_volume(width:Int, height:Int, depth:Int) -> [(Double, Double, Double, Double)]`
31+
#### `func` `sample_volume(width:Int, height:Int, depth:Int) -> [(Double, Double, Double, Double)]`
3332
> 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.
3433
35-
#### `func` `sample_volume_saturated_to_u8(width:Int, height:Int, depth:Int, offset:Double = 0.5) -> [UInt8]`
34+
#### `func` `sample_volume_saturated_to_u8(width:Int, height:Int, depth:Int, offset:Double = 0.5) -> [UInt8]`
3635
> 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`.

Sources/Noise/docs.docc/struct-CellNoise2D.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``CellNoise2D``
22

3-
# `CellNoise2D`
43
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.
54

65
Unlike many other cell noise implementations, *Noise*’s implementation samples all relevant generating-points, preventing artifacts or discontinuities from ever appearing in the noise. Accordingly, *Noise*’s implementation is heavily optimized to prevent the additional edge cases from impacting the performance of the cell noise.

Sources/Noise/docs.docc/struct-CellNoise3D.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``CellNoise3D``
22

3-
# `CellNoise3D`
43
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.
54

65
Unlike many other cell noise implementations, *Noise*’s implementation samples all relevant generating-points, preventing artifacts or discontinuities from ever appearing in the noise. Accordingly, *Noise*’s implementation is heavily optimized to prevent the additional edge cases from impacting the performance of the cell noise.

Sources/Noise/docs.docc/struct-DiskSampler2D.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``DiskSampler2D``
22

3-
# `DiskSampler2D`
43
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).
54

65
Disk samples are not a noise field — its generation is inherently sequential, as opposed to most procedural noise fields which are embarrassingly parallel. Thus, disk samples have no concept of *evaluation*; the entire sample set must be generated as a whole.

Sources/Noise/docs.docc/struct-FBM.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``FBM``
22

3-
# `FBM`
43
A generic [fractal brownian motion](https://thebookofshaders.com/13/) noise generator, capable of overlaying multiple instances of procedural [noise](protocol-Noise.md) at increasing frequencies.
54

65
![](png/banner_FBM.png)

Sources/Noise/docs.docc/struct-PermutationTable.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``PermutationTable``
22

3-
# `PermutationTable`
43
An 8-bit permutation table useful for generating pseudo-random hash values.
54

65
![](png/banner_voronoi2d.png)

Sources/Noise/docs.docc/struct-RandomXorshift.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
###### Structure
1+
# ``RandomXorshift``
22

3-
# `RandomXorshift`
43
A cryptographically unsecure 128-bit [Xorshift](https://en.wikipedia.org/wiki/Xorshift) pseudo-random number generator.
54

65
***
76

87
## Symbols
98

10-
### Instance properties
9+
### Instance properties
1110

1211
#### `var` `max:UInt32 { get }`
1312
> The maximum unsigned integer value the random number generator is capable of producing.
1413
15-
### Instance methods
14+
### Instance methods
1615

1716
#### `mutating func` `generate() -> UInt32`
1817
> Generates a pseudo-random 32 bit unsigned integer, and advances the random number generator state.

Sources/Noise/docs.docc/struct-SimplexNoise2D.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``SimplexNoise2D``
22

3-
# `SimplexNoise2D`
43
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 was originally an open-source improvement on the classical Perlin gradient noise algorithm, and thus is often referred to as OpenSimplex noise, to distinguish it from a patented variant of simplex noise. 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](struct-SuperSimplexNoise2D.md).
54

65
In almost all cases, super-simplex noise should be preferred.
@@ -34,7 +33,7 @@ In almost all cases, super-simplex noise should be preferred.
3433
#### `func` [`sample_area_saturated_to_u8`](protocol-Noise.md#func-sample_area_saturated_to_u8widthint-heightint-offsetdouble--05---uint8)`(width:Int, height:Int, offset:Double = 0.5) -> [UInt8]`
3534
> 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`.
3635
37-
#### `func` [`sample_volume`](protocol-Noise.md#func-sample_volumewidthint-heightint-depthint---double-double-double-double)`(width:Int, height:Int, depth:Int) -> [(Double, Double, Double, Double)]`
36+
#### `func` [`sample_volume`](protocol-Noise.md#func-sample_volumewidthint-heightint-depthint---double-double-double-double)`(width:Int, height:Int, depth:Int) -> [(Double, Double, Double, Double)]`
3837
> 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.
3938
4039
#### `func` [`sample_volume_saturated_to_u8`](protocol-Noise.md#func-sample_volume_saturated_to_u8widthint-heightint-depthint-offsetdouble--05---uint8)`(width:Int, height:Int, depth:Int, offset:Double = 0.5) -> [UInt8]`

Sources/Noise/docs.docc/struct-SuperSimplexNoise2D.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``SuperSimplexNoise2D``
22

3-
# `SuperSimplexNoise2D`
43
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](struct-SimplexNoise2D.md) which runs faster and scales better to higher dimensions. (Simplex noise in turn is an improvement on the classical Perlin gradient noise algorithm.)
54

65
In almost all cases, super-simplex noise should be preferred over its predecessors. Super-simplex noise runs about 25% faster than its simplex predecessor, and produces higher quality gradient noise. Super-simplex noise also comes in a [three-dimensional](struct-SuperSimplexNoise3D.md) version.

Sources/Noise/docs.docc/struct-SuperSimplexNoise3D.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
###### Structure
1+
# ``SuperSimplexNoise3D``
22

3-
# `SuperSimplexNoise3D`
43
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.
54

65
Three-dimensional super-simplex noise generally looks somewhat better visually than its [two-dimensional](struct-SuperSimplexNoise2D.md) counterpart, but runs about 20% slower.

0 commit comments

Comments
 (0)